aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-11-12 23:49:52 +0800
committerWilmer van der Gaast <wilmer@gaast.net>2011-11-12 23:49:52 +0800
commitdff732d93799db858a5728abbf31d2e6274b8425 (patch)
treec7f61eccdb8584b4d2784656883725dc08768ecd
parentdac74bdcfcc358cd59a318e34a54a3b17ebf3459 (diff)
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.
-rw-r--r--lib/http_client.c11
-rw-r--r--protocols/msn/soap.h6
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/http_client.c b/lib/http_client.c
index 8b045414..f535f13f 100644
--- a/lib/http_client.c
+++ b/lib/http_client.c
@@ -313,7 +313,7 @@ got_reply:
req->status_code = -1;
}
- if( ( req->status_code == 301 || req->status_code == 302 ) && req->redir_ttl-- > 0 )
+ if( ( req->status_code >= 301 && req->status_code <= 303 ) && req->redir_ttl-- > 0 )
{
char *loc, *new_request, *new_host;
int error = 0, new_port, new_proto;
@@ -374,10 +374,13 @@ got_reply:
/* So, now I just allocated enough memory, so I'm
going to use strcat(), whether you like it or not. :-) */
- sprintf( new_request, "GET %s HTTP/1.0", url->file );
+ *s = 0;
+ sprintf( new_request, "%s %s HTTP/1.0\r\nHost: %s",
+ req->status_code == 303 || req->request[0] == 'G' ? "GET" : "POST", url->file, url->host );
+ *s = ' ';
- s = strstr( req->request, "\r\n" );
- if( s == NULL )
+ if( !( ( s = strstr( req->request, "\r\nHost: " ) ) &&
+ ( s = strstr( s + strlen( "\r\nHost: " ), "\r\n" ) ) ) )
{
req->status_string = g_strdup( "Error while rebuilding request string" );
g_free( new_request );
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 );
"<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>" \
"<wsp:AppliesTo>" \
"<wsa:EndpointReference>" \
- "<wsa:Address>local-bay.contacts.msn.com</wsa:Address>" \
+ "<wsa:Address>contacts.msn.com</wsa:Address>" \
"</wsa:EndpointReference>" \
"</wsp:AppliesTo>" \
"<wsse:PolicyReference xmlns=\"http://schemas.xmlsoap.org/ws/2003/06/secext\" URI=\"MBI\"></wsse:PolicyReference>" \
@@ -198,7 +198,7 @@ int msn_soap_oim_send_queue( struct im_connection *ic, GSList **msgq );
"</soap:Body>" \
"</soap:Envelope>"
-#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 \