/soc/2015/jgeboski/facebook: 1da02f9677f8: facebook: added HTTP ...
James Geboski
jgeboski at gmail.com
Mon Jul 13 11:01:11 EDT 2015
Changeset: 1da02f9677f8ae6fae8f8ae39a5b693d58491eb4
Author: James Geboski <jgeboski at gmail.com>
Date: 2015-07-13 11:01 -0400
Branch: facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/1da02f9677f8
Description:
facebook: added HTTP status to debug messages
diffstat:
libpurple/protocols/facebook/api.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diffs (30 lines):
diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -357,12 +357,26 @@ fb_api_http_chk(FbApi *api, PurpleHttpCo
JsonNode **root)
{
const gchar *data;
+ const gchar *msg;
+ gchar *emsg;
GError *err = NULL;
+ gint code;
gsize size;
+ msg = purple_http_response_get_error(res);
+ code = purple_http_response_get_code(res);
data = purple_http_response_get_data(res, &size);
+
+ if (msg != NULL) {
+ emsg = g_strdup_printf("%s (%d)", msg, code);
+ } else {
+ emsg = g_strdup_printf("%d", code);
+ }
+
fb_util_debug(FB_UTIL_DEBUG_INFO, "HTTP Response (%p):", con);
+ fb_util_debug(FB_UTIL_DEBUG_INFO, " Response Error: %s", emsg);
fb_util_debug(FB_UTIL_DEBUG_INFO, " Response Data: %s", data);
+ g_free(emsg);
if (!fb_http_error_chk(res, &err)) {
FB_API_ERROR_CHK(api, err, return FALSE);
More information about the Commits
mailing list