... at the time drain_and_close_socket() is called.
As Lee noticed it causes problems on Windows, most likely because
read_socket() is blocking which isn't even wrong and could also
happen on other platforms.
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.118 2012/10/21 12:44:58 fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.119 2012/10/23 10:17:36 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
{
char drainage[500];
+ if (!data_is_available(fd, 0))
+ {
+ /*
+ * If there is no data available right now, don't try
+ * to drain the socket as read_socket() could block.
+ */
+ break;
+ }
+
bytes_drained = read_socket(fd, drainage, sizeof(drainage));
if (bytes_drained < 0)
{