Package: libnanohttp1
Version: 1.1.0-16
Severity: normal

00:03:36.475727 read(9, ""..., 2048)    = 0
00:03:36.475829 select(10, [9], NULL, NULL, {5, 0}) = 1 (in [9], left {5, 
0})
00:03:36.475944 read(9, ""..., 2048)    = 0
00:03:36.476038 select(10, [9], NULL, NULL, {5, 0}) = 1 (in [9], left {5, 
0})

My SOAP client program has gone into an infinite loop, it looped for a day
in the above.

The following patch (which is not tested at this time) should fix it.

diff -ru libcsoap-1.1.0.bak/nanohttp/nanohttp-ssl.c 
libcsoap-1.1.0/nanohttp/nanohttp-ssl.c
--- libcsoap-1.1.0.bak/nanohttp/nanohttp-ssl.c  2009-07-19 15:46:58.000000000 
+1000
+++ libcsoap-1.1.0/nanohttp/nanohttp-ssl.c      2009-08-06 22:45:48.000000000 
+1000
@@ -543,13 +543,17 @@
   }
   else
   {
-    if ((count = hsocket_select_read(sock->sock, buf, len)) == -1)
+    count = hsocket_select_read(sock->sock, buf, len);
+    if(count == -1)
     {
       char err_buf[256];
       strerror_r(errno, err_buf, sizeof(err_buf));
       return herror_new("hssl_read", HSOCKET_ERROR_RECEIVE,
                         "recv failed (%s)", err_buf);
     }
+    if(count == 0)
+      return herror_new("hssl_read", HSOCKET_ERROR_RECEIVE,
+                        "recv failed (socket closed)");
   }
   *received = count;
 



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to