From a5fb5edfc935e1dc3c71db1adb8dced47df67a0f Mon Sep 17 00:00:00 2001 From: Stefan Sommerfeld Date: Sun, 7 Nov 2010 14:13:50 -0200 Subject: [PATCH] Make notify_send_and_recv() return the appropriate error code. notify_send_and_recv() was returning the connection fd. --- upnp/src/gena/gena_device.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/upnp/src/gena/gena_device.c b/upnp/src/gena/gena_device.c index 7d866eb..2ec7e26 100644 --- a/upnp/src/gena/gena_device.c +++ b/upnp/src/gena/gena_device.c @@ -195,8 +195,7 @@ static UPNP_INLINE int notify_send_and_recv( conn_fd = http_Connect(destination_url, &url); if (conn_fd < 0) { /* return UPNP error */ - - return conn_fd; + return UPNP_E_SOCKET_CONNECT; } ret_code = sock_init(&info, conn_fd); @@ -293,11 +292,9 @@ static int genaNotify( // send a notify to each url until one goes thru for( i = 0; i < sub->DeliveryURLs.size; i++ ) { url = &sub->DeliveryURLs.parsedURLs[i]; - - if( ( return_code = notify_send_and_recv( url, - &mid_msg, propertySet, - &response ) ) == - UPNP_E_SUCCESS ) { + return_code = notify_send_and_recv( + url, &mid_msg, propertySet,&response); + if (return_code == UPNP_E_SUCCESS) { break; } }