summaryrefslogtreecommitdiff
path: root/src/trg-client.h
diff options
context:
space:
mode:
authorGravatar Alan F <ajf@eth0.org.uk>2014-03-11 19:36:46 +0000
committerGravatar Alan F <ajf@eth0.org.uk>2014-03-11 19:36:46 +0000
commite22015c6d3e8860b1994a22919bdb1f6066fcbe9 (patch)
tree26a97278114899b5b4d7b8f0d8389dd363a6f067 /src/trg-client.h
parent1a5447c0138fd25e3f6d78f78593f5b70be5614a (diff)
refactor TrgClient, also allowing cookies to be set on requests
Diffstat (limited to 'src/trg-client.h')
-rw-r--r--src/trg-client.h12
1 files changed, 6 insertions, 6 deletions
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*/