From 631b8a075cf938d1aece6bd6f8379e00596c3dc2 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 15 Jan 2009 15:43:21 +0000 Subject: Add missing implementations for RestProxyCall functions (MB: #420) The following functions were missing implementations: rest_proxy_call_lookup_response_header rest_proxy_call_get_response_headers This change fixes that. --- rest/rest-proxy-call.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index 9540d09..e257335 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -762,6 +762,51 @@ error: return res; } +/** + * rest_proxy_call_lookup_response_header + * + * @call: The #RestProxyCall + * @header: The name of the header to lookup. + * + * Returns: The string value of the header @header or NULL if that header is + * not present or there are no headers. + */ +const gchar * +rest_proxy_call_lookup_response_header (RestProxyCall *call, + const gchar *header) +{ + RestProxyCallPrivate *priv = GET_PRIVATE (call); + + if (!priv->response_headers) + { + return NULL; + } + + return g_hash_table_lookup (priv->response_headers, header); +} + +/** + * rest_proxy_call_get_response_headers + * + * @call: The #RestProxyCall + * + * Returns: A pointer to a hash table of headers. This hash table must not be + * changed. You should call g_hash_table_unref() when you have finished with + * it. + */ +GHashTable * +rest_proxy_call_get_response_headers (RestProxyCall *call) +{ + RestProxyCallPrivate *priv = GET_PRIVATE (call); + + if (!priv->response_headers) + { + return NULL; + } + + return g_hash_table_ref (priv->response_headers); +} + /** * rest_proxy_call_get_payload_length: * @call: The #RestProxyCall -- cgit v1.2.3