[geany/geany-plugins] 8f97f3: geniuspaste: Show request and response in debug mode
Colomban Wendling
git-noreply at xxxxx
Sun Feb 21 08:49:44 UTC 2016
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Sat, 16 Jan 2016 21:46:54 UTC
Commit: 8f97f3856d838322bb20474b5f5250d6f563c68e
https://github.com/geany/geany-plugins/commit/8f97f3856d838322bb20474b5f5250d6f563c68e
Log Message:
-----------
geniuspaste: Show request and response in debug mode
This eases debugging a faulty pastebin configuration by showing the
actual data sent and received.
Modified Paths:
--------------
geniuspaste/src/geniuspaste.c
Modified: geniuspaste/src/geniuspaste.c
18 lines changed, 18 insertions(+), 0 deletions(-)
===================================================================
@@ -646,6 +646,24 @@ static void paste(GeanyDocument * doc, const gchar * website)
status = soup_session_send_message(session, msg);
g_object_unref(session);
+ if (geany->app->debug_mode)
+ {
+ gchar *real_uri = soup_uri_to_string(soup_message_get_uri(msg), FALSE);
+
+ soup_message_body_flatten(msg->request_body);
+ msgwin_msg_add(COLOR_BLUE, -1, NULL,
+ "[geniuspaste] %s\n"
+ "Request: %s\n"
+ "Response: %s\n"
+ "Code: %d (%s)",
+ real_uri,
+ msg->request_body->data,
+ msg->response_body->data,
+ msg->status_code,
+ msg->reason_phrase);
+ g_free(real_uri);
+ }
+
if (! SOUP_STATUS_IS_SUCCESSFUL(status))
{
show_msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list