projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Shorten the description of the incorrect assertion in case of socks5 connection failures
[privoxy.git]
/
jbsockets.c
diff --git
a/jbsockets.c
b/jbsockets.c
index
c16e75f
..
d650dba
100644
(file)
--- a/
jbsockets.c
+++ b/
jbsockets.c
@@
-1,4
+1,4
@@
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.11
8 2012/10/21 12:44:58
fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.11
9 2012/10/23 10:17:36
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
@@
-740,6
+740,15
@@
void drain_and_close_socket(jb_socket fd)
{
char drainage[500];
{
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)
{
bytes_drained = read_socket(fd, drainage, sizeof(drainage));
if (bytes_drained < 0)
{