projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
In socks5_connect(), require a complete socks response from the server
[privoxy.git]
/
gateway.c
diff --git
a/gateway.c
b/gateway.c
index
9ab19d5
..
de24572
100644
(file)
--- a/
gateway.c
+++ b/
gateway.c
@@
-1,4
+1,4
@@
-const char gateway_rcs[] = "$Id: gateway.c,v 1.7
7 2011/09/06 18:46:17
fabiankeil Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.7
9 2011/10/16 12:37:12
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
@@
-338,16
+338,12
@@
void forget_connection(jb_socket sfd)
sfd, reusable_connection[slot].host,
reusable_connection[slot].port, slot);
mark_connection_closed(&reusable_connection[slot]);
sfd, reusable_connection[slot].host,
reusable_connection[slot].port, slot);
mark_connection_closed(&reusable_connection[slot]);
- privoxy_mutex_unlock(&connection_reuse_mutex);
-
- return;
+ break;
}
}
}
}
- log_error(LOG_LEVEL_CONNECT,
- "Socket %d already forgotten or never remembered.", sfd);
-
privoxy_mutex_unlock(&connection_reuse_mutex);
privoxy_mutex_unlock(&connection_reuse_mutex);
+
}
#endif /* def FEATURE_CONNECTION_SHARING */
}
#endif /* def FEATURE_CONNECTION_SHARING */
@@
-947,7
+943,7
@@
static jb_socket socks5_connect(const struct forward_spec *fwd,
{
int err = 0;
char cbuf[300];
{
int err = 0;
char cbuf[300];
- char sbuf[
3
0];
+ char sbuf[
1
0];
size_t client_pos = 0;
int server_size = 0;
size_t hostlen = 0;
size_t client_pos = 0;
int server_size = 0;
size_t hostlen = 0;
@@
-1094,18
+1090,11
@@
static jb_socket socks5_connect(const struct forward_spec *fwd,
}
server_size = read_socket(sfd, sbuf, sizeof(sbuf));
}
server_size = read_socket(sfd, sbuf, sizeof(sbuf));
- if (server_size
< 3
)
+ if (server_size
!= sizeof(sbuf)
)
{
errstr = "SOCKS5 negotiation read failed";
err = 1;
}
{
errstr = "SOCKS5 negotiation read failed";
err = 1;
}
- else if (server_size > 20)
- {
- /* This is somewhat unexpected but doesn't really matter. */
- log_error(LOG_LEVEL_CONNECT, "socks5_connect: read %d bytes "
- "from socks server. Would have accepted up to %d.",
- server_size, sizeof(sbuf));
- }
if (!err)
{
if (!err)
{