diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2011-09-18 16:21:04 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2011-09-18 16:21:04 +0000 |
commit | 79cd86dbfd5b2ea0963c84b48088ec189acfc795 (patch) | |
tree | 535769200823fdaa1fec9795fe986668cb33bdee /src/json.c | |
parent | 63763bb00502e3c235e478ec50e097904c774696 (diff) |
Big changeset, may break stuff. Unfortunately you can't magically jump into the UI thread using gdk_threads_enter/leave() on Windows, the only way is to schedule a callback using g_idle_add. This required a lot of reworking. Good news, Windows support actually works now \o/
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -25,7 +25,6 @@ #include "config.h" #include "protocol-constants.h" #include "requests.h" -#include "dispatch.h" #include "json.h" gchar *trg_serialize(JsonNode * req) @@ -43,7 +42,7 @@ gchar *trg_serialize(JsonNode * req) return response; } -JsonObject *trg_deserialize(trg_http_response * response, +JsonObject *trg_deserialize(trg_response * reqrsp, GError ** error) { JsonParser *parser; @@ -51,13 +50,13 @@ JsonObject *trg_deserialize(trg_http_response * response, JsonObject *ret = NULL; parser = json_parser_new(); - json_parser_load_from_data(parser, response->data, response->size, + json_parser_load_from_data(parser, reqrsp->raw, reqrsp->size, error); if (*error == NULL) { root = json_parser_get_root(parser); #ifdef DEBUG if (g_getenv("TRG_SHOW_INCOMING") != NULL) { - g_debug("<=(INcoming)<=: %s", response->data); + g_debug("<=(INcoming)<=: %s", reqrsp->raw); } else if (g_getenv("TRG_SHOW_INCOMING_PRETTY") != NULL) { JsonGenerator *pg; gsize len; |