White spaces.

This commit is contained in:
Marcelo Roberto Jimenez 2010-09-03 21:51:31 -03:00
parent ebc941f265
commit b3b7a91a64

View File

@ -186,7 +186,7 @@ static UPNP_INLINE int notify_send_and_recv(
int timeout;
SOCKINFO info;
// connect
/* connect */
UpnpPrintf(UPNP_ALL, GENA, __FILE__, __LINE__,
"gena notify to: %.*s\n",
(int)destination_url->hostport.text.size,
@ -194,14 +194,18 @@ static UPNP_INLINE int notify_send_and_recv(
conn_fd = http_Connect(destination_url, &url);
if (conn_fd < 0) {
return conn_fd; // return UPNP error
/* return UPNP error */
return conn_fd;
}
if( ( ret_code = sock_init( &info, conn_fd ) ) != 0 ) {
ret_code = sock_init(&info, conn_fd);
if (ret_code) {
sock_destroy(&info, SD_BOTH);
return ret_code;
}
// make start line and HOST header
/* make start line and HOST header */
membuffer_init(&start_msg);
if (http_MakeMessage(
&start_msg, 1, 1,
@ -210,36 +214,37 @@ static UPNP_INLINE int notify_send_and_recv(
mid_msg->buf) != 0) {
membuffer_destroy(&start_msg);
sock_destroy(&info, SD_BOTH);
return UPNP_E_OUTOF_MEMORY;
}
timeout = HTTP_DEFAULT_TIMEOUT;
// send msg (note: end of notification will contain "\r\n" twice)
if( ( ret_code = http_SendMessage( &info, &timeout,
/* send msg (note: end of notification will contain "\r\n" twice) */
ret_code = http_SendMessage(&info, &timeout,
"bbb",
start_msg.buf, start_msg.length,
propertySet,
strlen( propertySet ),
"\r\n", strlen( "\r\n" ) ) ) !=
0 ) {
propertySet, strlen(propertySet),
"\r\n", 2);
if (ret_code) {
membuffer_destroy(&start_msg);
sock_destroy(&info, SD_BOTH);
return ret_code;
}
if( ( ret_code = http_RecvMessage( &info, response,
HTTPMETHOD_NOTIFY, &timeout,
&err_code ) ) != 0 ) {
ret_code = http_RecvMessage(&info, response,
HTTPMETHOD_NOTIFY, &timeout, &err_code);
if (ret_code) {
membuffer_destroy(&start_msg);
sock_destroy(&info, SD_BOTH);
httpmsg_destroy(&response->msg);
return ret_code;
}
sock_destroy( &info, SD_BOTH ); //should shutdown completely
//when closing socket
// sock_destroy( &info,SD_RECEIVE);
/* should shutdown completely when closing socket */
sock_destroy(&info, SD_BOTH);
membuffer_destroy(&start_msg);
return UPNP_E_SUCCESS;