# HG changeset patch # User Ka-Hing Cheung # Date 1190613894 0 # Node ID 1180920ffcec84934f6f81c6d5d15884be5ab09f # Parent 06527cc0f79bd7167fdc3a1b8f97cb1c3e0d8eb6 handle unauthenticated soap connection diff -r 06527cc0f79b -r 1180920ffcec libpurple/protocols/msn/soap2.c --- a/libpurple/protocols/msn/soap2.c Mon Sep 24 05:29:07 2007 +0000 +++ b/libpurple/protocols/msn/soap2.c Mon Sep 24 06:04:54 2007 +0000 @@ -365,25 +365,30 @@ int len = -1; char *body = xmlnode_to_str(req->message->xml, &len); GSList *iter; + char *authstr = NULL; g_queue_pop_head(conn->queue); conn->buf = g_string_new(""); + if (conn->session->passport_info.mspauth) + authstr = g_strdup_printf("Cookie: MSPAuth=%s\r\n", + conn->session->passport_info.mspauth); + + g_string_append_printf(conn->buf, "POST %s HTTP/1.1\r\n" "SOAPAction: %s\r\n" "Content-Type:text/xml; charset=utf-8\r\n" - "Cookie: MSPAuth=%s\r\n" + "%s" "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" "Accept: */*\r\n" "Host: %s\r\n" "Content-Length: %d\r\n" "Connection: Keep-Alive\r\n" "Cache-Control: no-cache\r\n", - req->path, req->message->action, - conn->session->passport_info.mspauth, - conn->host, len); + req->path, req->message->action ? req->message->action : "", + authstr ? authstr : "", conn->host, len); for (iter = req->message->headers; iter; iter = iter->next) { g_string_append(conn->buf, (char *)iter->data); @@ -399,6 +404,8 @@ conn->event_handle = purple_input_add(conn->ssl->fd, PURPLE_INPUT_WRITE, msn_soap_write_cb, conn); msn_soap_write_cb(conn, conn->ssl->fd, PURPLE_INPUT_WRITE); + + g_free(authstr); } }