projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
24ae510
)
Let socks4_connect enforce the socket timeout for the negotiation response as well.
author
Fabian Keil
<fk@fabiankeil.de>
Sun, 9 Jan 2011 12:08:52 +0000
(12:08 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Sun, 9 Jan 2011 12:08:52 +0000
(12:08 +0000)
gateway.c
patch
|
blob
|
history
diff --git
a/gateway.c
b/gateway.c
index
bd6a3d9
..
6ccfcbc
100644
(file)
--- a/
gateway.c
+++ b/
gateway.c
@@
-1,4
+1,4
@@
-const char gateway_rcs[] = "$Id: gateway.c,v 1.6
5 2010/04/23 11:53:48
fabiankeil Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.6
6 2011/01/09 12:08:35
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
@@
-809,6
+809,20
@@
static jb_socket socks4_connect(const struct forward_spec * fwd,
errstr = "connect_to failed: see logfile for details";
err = 1;
}
errstr = "connect_to failed: see logfile for details";
err = 1;
}
+ else if (!data_is_available(sfd, csp->config->socket_timeout))
+ {
+ if (socket_is_still_alive(sfd))
+ {
+ errstr = "SOCKS4 negotiation timed out";
+ }
+ else
+ {
+ errstr = "SOCKS4 negotiation got aborted by the server";
+ }
+ log_error(LOG_LEVEL_CONNECT, "socks4_connect: %s", errstr);
+ err = 1;
+ close_socket(sfd);
+ }
else if (write_socket(sfd, (char *)c, csiz))
{
errstr = "SOCKS4 negotiation write failed.";
else if (write_socket(sfd, (char *)c, csiz))
{
errstr = "SOCKS4 negotiation write failed.";