/soc/2015/jgeboski/facebook: 1da02f9677f8: facebook: added HTTP ...

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 1da02f9677f8ae6fae8f8ae39a5b693d58491eb4
Author:	 James Geboski <[email protected]>
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);

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.