summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2009-01-15 15:43:21 +0000
committerRob Bradford <rob@linux.intel.com>2009-01-15 15:43:21 +0000
commit631b8a075cf938d1aece6bd6f8379e00596c3dc2 (patch)
treec1b7604f56aaf4771dbacd4ebc46d955abeb46a0
parent131f3a8e5367cf4b153cc5fe73bc1530633b92c9 (diff)
Add missing implementations for RestProxyCall functions (MB: #420)librest-0.1
The following functions were missing implementations: rest_proxy_call_lookup_response_header rest_proxy_call_get_response_headers This change fixes that.
-rw-r--r--rest/rest-proxy-call.c45
1 files changed, 45 insertions, 0 deletions
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
@@ -763,6 +763,51 @@ error:
}
/**
+ * 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
*