From e22015c6d3e8860b1994a22919bdb1f6066fcbe9 Mon Sep 17 00:00:00 2001 From: Alan F Date: Tue, 11 Mar 2014 19:36:46 +0000 Subject: refactor TrgClient, also allowing cookies to be set on requests --- src/trg-client.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/trg-client.h') diff --git a/src/trg-client.h b/src/trg-client.h index ce98a4e..349666e 100644 --- a/src/trg-client.h +++ b/src/trg-client.h @@ -71,10 +71,11 @@ typedef struct { typedef struct { gint connid; JsonNode *node; - gchar *str; + gchar *body; gchar *url; GSourceFunc callback; gpointer cb_data; + gchar *cookie; } trg_request; typedef struct _TrgClientPrivate TrgClientPrivate; @@ -119,17 +120,16 @@ typedef struct { /* stuff that used to be in http.h */ void trg_response_free(trg_response * response); -int trg_http_perform(TrgClient * client, gchar * reqstr, - trg_response * reqrsp); +int trg_http_perform(TrgClient * tc, trg_request *request, trg_response * rsp); + /* end http.h*/ /* stuff that used to be in dispatch.c */ -trg_response *dispatch(TrgClient * client, JsonNode * req); -trg_response *dispatch_str(TrgClient * client, gchar * req); +trg_response *dispatch(TrgClient * tc, trg_request *req); trg_response *dispatch_public_http(TrgClient *tc, trg_request *req); gboolean dispatch_async(TrgClient * client, JsonNode * req, GSourceFunc callback, gpointer data); -gboolean async_http_request(TrgClient *tc, gchar *url, GSourceFunc callback, gpointer data); +gboolean async_http_request(TrgClient *tc, gchar *url, const gchar *cookie, GSourceFunc callback, gpointer data); /* end dispatch.c*/ -- cgit v1.2.3