Mercurial > pidgin.yaz
diff libpurple/protocols/msn/soap.c @ 23300:5cdd93dac7a2
Delete trailing whitespace
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 06 Jun 2008 22:46:04 +0000 |
parents | 05cb3f04c01e |
children | 1ac5faa72c8d |
line wrap: on
line diff
--- a/libpurple/protocols/msn/soap.c Fri Jun 06 22:35:27 2008 +0000 +++ b/libpurple/protocols/msn/soap.c Fri Jun 06 22:46:04 2008 +0000 @@ -1,5 +1,5 @@ /** - * @file soap.c + * @file soap.c * SOAP connection related process * Author * MaYuan<mayuan2006@gmail.com> @@ -107,7 +107,7 @@ /*ssl soap error callback*/ static void msn_soap_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, void *data) -{ +{ MsnSoapConn * soapconn = data; g_return_if_fail(data != NULL); @@ -159,7 +159,7 @@ if (*handler > 0) { purple_input_remove(*handler); *handler = 0; - } + } #ifdef MSN_SOAP_DEBUG else { purple_debug_misc("MSN SOAP", "Handler inactive, not removing\n"); @@ -250,7 +250,7 @@ { gssize len, requested_len; char temp_buf[MSN_SOAP_READ_BUFF_SIZE]; - + if ( soapconn->need_to_read == 0 || soapconn->need_to_read > MSN_SOAP_READ_BUFF_SIZE) { requested_len = MSN_SOAP_READ_BUFF_SIZE; } @@ -264,7 +264,7 @@ len = read(soapconn->fd, temp_buf, requested_len); } - + if ( len <= 0 ) { switch (errno) { @@ -298,7 +298,7 @@ soapconn->read_len + len + 1); exit(EXIT_FAILURE); } - + } #if defined(MSN_SOAP_DEBUG) @@ -312,7 +312,7 @@ } /*read the whole SOAP server response*/ -static void +static void msn_soap_read_cb(gpointer data, gint source, PurpleInputCondition cond) { MsnSoapConn *soapconn = data; @@ -331,10 +331,10 @@ session = soapconn->session; g_return_if_fail(session != NULL); - + /*read the request header*/ len = msn_soap_read(soapconn); - + if ( len < 0 ) return; @@ -342,7 +342,7 @@ return; } - if ( (strstr(soapconn->read_buf, "HTTP/1.1 302") != NULL) + if ( (strstr(soapconn->read_buf, "HTTP/1.1 302") != NULL) || ( strstr(soapconn->read_buf, "HTTP/1.1 301") != NULL ) ) { /* Redirect. */ @@ -382,14 +382,14 @@ g_free(soapconn->login_host); soapconn->login_host = g_strdup(location); - + msn_soap_close_handler( &(soapconn->input_handler) ); msn_soap_close(soapconn); if (purple_ssl_connect(session->account, soapconn->login_host, PURPLE_SSL_DEFAULT_PORT, msn_soap_connect_cb, msn_soap_error_cb, soapconn) == NULL) { - + purple_debug_error("MSN SOAP", "Unable to connect to %s !\n", soapconn->login_host); // dispatch next request msn_soap_post(soapconn, NULL); @@ -429,7 +429,7 @@ g_free(soapconn->login_host); soapconn->login_host = g_strdup(location); - + msn_soap_close_handler( &(soapconn->input_handler) ); msn_soap_close(soapconn); @@ -489,7 +489,7 @@ } } } - + } else if (strstr(soapconn->read_buf, "HTTP/1.1 503 Service Unavailable")) { @@ -539,11 +539,11 @@ #if defined(MSN_SOAP_DEBUG) && !defined(_WIN32) node = xmlnode_from_str(soapconn->body, soapconn->body_len); - + if (node != NULL) { formattedxml = xmlnode_to_formatted_str(node, NULL); http_headers = g_strndup(soapconn->read_buf, soapconn->body - soapconn->read_buf); - + purple_debug_info("MSN SOAP","Data with XML payload received from the SOAP server:\n%s%s\n", http_headers, formattedxml); g_free(http_headers); g_free(formattedxml); @@ -572,22 +572,22 @@ if ( soapconn->read_cb != NULL ) { soapconn_is_valid = soapconn->read_cb(soapconn); } - + if (!soapconn_is_valid) { return; } /* dispatch next request in queue */ msn_soap_post(soapconn, NULL); - } + } return; } -void +void msn_soap_free_read_buf(MsnSoapConn *soapconn) { g_return_if_fail(soapconn != NULL); - + if (soapconn->read_buf) { g_free(soapconn->read_buf); } @@ -626,7 +626,7 @@ } total_len = strlen(soapconn->write_buf); - /* + /* * write the content to SSL server, */ len = purple_ssl_write(soapconn->gsc, @@ -690,7 +690,7 @@ soapconn->write_buf = write_buf; soapconn->written_len = 0; soapconn->written_cb = written_cb; - + msn_soap_free_read_buf(soapconn); /*clear the read buffer first*/ @@ -748,7 +748,7 @@ { g_return_if_fail(soapconn != NULL); g_return_if_fail(soapconn->soap_queue != NULL); - + if (soapconn->step == MSN_SOAP_CONNECTED || soapconn->step == MSN_SOAP_CONNECTED_IDLE) { @@ -868,7 +868,7 @@ else purple_debug_info("MSN SOAP","Failed to parse SOAP request being sent:\n%s\n", request_str); #endif - + /*free read buffer*/ // msn_soap_free_read_buf(soapconn); /*post it to server*/