From ff1616b7f25775ead76768c2b78c2ca01aac830f Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 9 Nov 2011 08:07:22 +0800 Subject: Fixed bug in msn_soap_debug_print() failing to print HTTP headers of SOAP queries. No, this doesn't fix #850, I just found this bug while trying to get debugging info for that. --- protocols/msn/soap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols/msn') diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c index dac46a75..cbc384be 100644 --- a/protocols/msn/soap.c +++ b/protocols/msn/soap.c @@ -215,7 +215,7 @@ static void msn_soap_debug_print( const char *headers, const char *payload ) return; if( ( s = strstr( headers, "\r\n\r\n" ) ) ) - st = write( 1, s, s - headers + 4 ); + st = write( 1, headers, s - headers + 4 ); else st = write( 1, headers, strlen( headers ) ); -- cgit v1.2.3 From dac74bdcfcc358cd59a318e34a54a3b17ebf3459 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 10 Nov 2011 11:38:40 +0800 Subject: Workaround/Fix for MSN login troubles, many thanks to necropresto. Bug #850. --- protocols/msn/soap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/msn') diff --git a/protocols/msn/soap.h b/protocols/msn/soap.h index a767e00d..69f76739 100644 --- a/protocols/msn/soap.h +++ b/protocols/msn/soap.h @@ -115,7 +115,7 @@ int msn_soapq_flush( struct im_connection *ic, gboolean resend ); "http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue" \ "" \ "" \ - "contacts.msn.com" \ + "local-bay.contacts.msn.com" \ "" \ "" \ "" \ @@ -198,7 +198,7 @@ int msn_soap_oim_send_queue( struct im_connection *ic, GSList **msgq ); "" \ "" -#define SOAP_MEMLIST_URL "http://contacts.msn.com/abservice/SharingService.asmx" +#define SOAP_MEMLIST_URL "http://local-bay.contacts.msn.com/abservice/SharingService.asmx" #define SOAP_MEMLIST_ACTION "http://www.msn.com/webservices/AddressBook/FindMembership" #define SOAP_MEMLIST_PAYLOAD \ @@ -233,7 +233,7 @@ int msn_soap_memlist_request( struct im_connection *ic ); int msn_soap_memlist_edit( struct im_connection *ic, const char *handle, gboolean add, int list ); -#define SOAP_ADDRESSBOOK_URL "http://contacts.msn.com/abservice/abservice.asmx" +#define SOAP_ADDRESSBOOK_URL "http://local-bay.contacts.msn.com/abservice/abservice.asmx" #define SOAP_ADDRESSBOOK_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll" #define SOAP_ADDRESSBOOK_PAYLOAD \ -- cgit v1.2.3 From dff732d93799db858a5728abbf31d2e6274b8425 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 12 Nov 2011 23:49:52 +0800 Subject: Undoing old workaround for MSN troubles and added more proper fix. The http_client module needs some refactoring though. Will do that later.. This should hopefully fix bug #850. --- protocols/msn/soap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/msn') diff --git a/protocols/msn/soap.h b/protocols/msn/soap.h index 69f76739..a767e00d 100644 --- a/protocols/msn/soap.h +++ b/protocols/msn/soap.h @@ -115,7 +115,7 @@ int msn_soapq_flush( struct im_connection *ic, gboolean resend ); "http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue" \ "" \ "" \ - "local-bay.contacts.msn.com" \ + "contacts.msn.com" \ "" \ "" \ "" \ @@ -198,7 +198,7 @@ int msn_soap_oim_send_queue( struct im_connection *ic, GSList **msgq ); "" \ "" -#define SOAP_MEMLIST_URL "http://local-bay.contacts.msn.com/abservice/SharingService.asmx" +#define SOAP_MEMLIST_URL "http://contacts.msn.com/abservice/SharingService.asmx" #define SOAP_MEMLIST_ACTION "http://www.msn.com/webservices/AddressBook/FindMembership" #define SOAP_MEMLIST_PAYLOAD \ @@ -233,7 +233,7 @@ int msn_soap_memlist_request( struct im_connection *ic ); int msn_soap_memlist_edit( struct im_connection *ic, const char *handle, gboolean add, int list ); -#define SOAP_ADDRESSBOOK_URL "http://local-bay.contacts.msn.com/abservice/abservice.asmx" +#define SOAP_ADDRESSBOOK_URL "http://contacts.msn.com/abservice/abservice.asmx" #define SOAP_ADDRESSBOOK_ACTION "http://www.msn.com/webservices/AddressBook/ABFindAll" #define SOAP_ADDRESSBOOK_PAYLOAD \ -- cgit v1.2.3 From 3bd2f17754009d84df1aeb60cfa1d3510182e87c Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 25 Nov 2011 12:16:05 +0000 Subject: msn_soap_debug_print may get called with NULL pointers. Pay attention. --- protocols/msn/soap.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'protocols/msn') diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c index cbc384be..467429fb 100644 --- a/protocols/msn/soap.c +++ b/protocols/msn/soap.c @@ -214,12 +214,16 @@ static void msn_soap_debug_print( const char *headers, const char *payload ) if( !getenv( "BITLBEE_DEBUG" ) ) return; - if( ( s = strstr( headers, "\r\n\r\n" ) ) ) - st = write( 1, headers, s - headers + 4 ); - else - st = write( 1, headers, strlen( headers ) ); + if( headers ) + { + if( ( s = strstr( headers, "\r\n\r\n" ) ) ) + st = write( 1, headers, s - headers + 4 ); + else + st = write( 1, headers, strlen( headers ) ); + } #ifdef DEBUG + if( payload ) { struct xt_node *xt = xt_from_string( payload ); if( xt ) -- cgit v1.2.3 From c77406ae3fd357c3d2eabd36ec524e049e265857 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 26 Nov 2011 18:41:24 +0000 Subject: MSN: No clue if the OUT command can specify other reasons, but if so, show it to the user. --- protocols/msn/ns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'protocols/msn') diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 604e2f4e..e144a8d2 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -479,7 +479,8 @@ static int msn_ns_command( struct msn_handler_data *handler, char **cmd, int num } else { - imcb_error( ic, "Session terminated by remote server (reason unknown)" ); + imcb_error( ic, "Session terminated by remote server (%s)", + cmd[1] ? cmd[1] : "reason unknown)" ); } imc_logout( ic, allow_reconnect ); -- cgit v1.2.3 From bd3166176fdb7ed96211eb539316f47843e0faa7 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 2 Dec 2011 10:32:54 +0000 Subject: Somewhat improve debug logging of HTTP/SOAP stuff. --- protocols/msn/soap.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'protocols/msn') diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c index 467429fb..ea9a0699 100644 --- a/protocols/msn/soap.c +++ b/protocols/msn/soap.c @@ -222,7 +222,6 @@ static void msn_soap_debug_print( const char *headers, const char *payload ) st = write( 1, headers, strlen( headers ) ); } -#ifdef DEBUG if( payload ) { struct xt_node *xt = xt_from_string( payload ); @@ -230,7 +229,6 @@ static void msn_soap_debug_print( const char *headers, const char *payload ) xt_print( xt ); xt_free_node( xt ); } -#endif } int msn_soapq_flush( struct im_connection *ic, gboolean resend ) -- cgit v1.2.3 From ca974d7f6171a70c5484420bd6c59919383105a6 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 4 Dec 2011 19:14:29 +0000 Subject: Debug output tweaks: Try to send everything to stderr, and add ifdef to enable printing of all SSL traffic. --- protocols/msn/soap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'protocols/msn') diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c index ea9a0699..ccfc1a67 100644 --- a/protocols/msn/soap.c +++ b/protocols/msn/soap.c @@ -217,9 +217,9 @@ static void msn_soap_debug_print( const char *headers, const char *payload ) if( headers ) { if( ( s = strstr( headers, "\r\n\r\n" ) ) ) - st = write( 1, headers, s - headers + 4 ); + st = write( 2, headers, s - headers + 4 ); else - st = write( 1, headers, strlen( headers ) ); + st = write( 2, headers, strlen( headers ) ); } if( payload ) @@ -662,7 +662,7 @@ static xt_status msn_soap_memlist_member( struct xt_node *node, gpointer data ) bd->flags |= MSN_BUDDY_PL; if( getenv( "BITLBEE_DEBUG" ) ) - printf( "%p %s %d\n", bu, handle, bd->flags ); + fprintf( stderr, "%p %s %d\n", bu, handle, bd->flags ); return XT_HANDLED; } @@ -809,7 +809,7 @@ static xt_status msn_soap_addressbook_group( struct xt_node *node, gpointer data } if( getenv( "BITLBEE_DEBUG" ) ) - printf( "%s %s\n", id, name ); + fprintf( stderr, "%s %s\n", id, name ); return XT_HANDLED; } @@ -870,7 +870,7 @@ static xt_status msn_soap_addressbook_contact( struct xt_node *node, gpointer da imcb_add_buddy( ic, handle, group->name ); if( getenv( "BITLBEE_DEBUG" ) ) - printf( "%s %s %s %s\n", id, type, handle, display_name ); + fprintf( stderr, "%s %s %s %s\n", id, type, handle, display_name ); return XT_HANDLED; } -- cgit v1.2.3 From 5dc7f907bf24e52f83b9d2e7613cf4e1f7aebcdf Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 6 Dec 2011 01:53:16 +0100 Subject: msn: unused-but-set-variables --- protocols/msn/sb.c | 6 ------ protocols/msn/soap.c | 5 ++--- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'protocols/msn') diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 37ac2889..69114469 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -307,7 +307,6 @@ gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond ) { struct msn_switchboard *sb = data; struct im_connection *ic; - struct msn_data *md; char buf[1024]; /* Are we still alive? */ @@ -315,7 +314,6 @@ gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond ) return FALSE; ic = sb->ic; - md = ic->proto_data; if( source != sb->fd ) { @@ -674,16 +672,12 @@ static int msn_sb_message( struct msn_handler_data *handler, char *msg, int msgl struct msn_switchboard *sb = handler->data; struct im_connection *ic = sb->ic; char *body; - int blen = 0; if( !num_parts ) return( 1 ); if( ( body = strstr( msg, "\r\n\r\n" ) ) ) - { body += 4; - blen = msglen - ( body - msg ); - } if( strcmp( cmd[0], "MSG" ) == 0 ) { diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c index ccfc1a67..7d9f3791 100644 --- a/protocols/msn/soap.c +++ b/protocols/msn/soap.c @@ -209,7 +209,6 @@ static char *msn_soap_abservice_build( const char *body_fmt, const char *scenari static void msn_soap_debug_print( const char *headers, const char *payload ) { char *s; - int st; if( !getenv( "BITLBEE_DEBUG" ) ) return; @@ -217,9 +216,9 @@ static void msn_soap_debug_print( const char *headers, const char *payload ) if( headers ) { if( ( s = strstr( headers, "\r\n\r\n" ) ) ) - st = write( 2, headers, s - headers + 4 ); + write( 2, headers, s - headers + 4 ); else - st = write( 2, headers, strlen( headers ) ); + write( 2, headers, strlen( headers ) ); } if( payload ) -- cgit v1.2.3