diff options
author | Roger Dingledine <arma@torproject.org> | 2004-12-22 10:04:50 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-12-22 10:04:50 +0000 |
commit | f50b785c3b914929135436daea39b04b77ca585c (patch) | |
tree | 5333b13d9bfaa513b38a64b6a0413f2e5b023c50 /src | |
parent | 18320557a17188b7747116f1f4b51fc567e60f77 (diff) | |
download | tor-f50b785c3b914929135436daea39b04b77ca585c.tar.gz tor-f50b785c3b914929135436daea39b04b77ca585c.zip |
and forward port the cleanup
svn:r3211
Diffstat (limited to 'src')
-rw-r--r-- | src/or/buffers.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 008babb488..0db40ed965 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -584,19 +584,19 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { tor_assert(next < buf->mem+buf->datalen); startaddr = NULL; - if (socks4_prot == socks4a && next+1 == buf->mem+buf->datalen) { - log_fn(LOG_DEBUG,"socks4: No part of destaddr here yet."); - return 0; - } if (socks4_prot != socks4a && !have_warned_about_unsafe_socks) { log_fn(LOG_WARN,"Your application (using socks4 on port %d) is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead.", req->port); // have_warned_about_unsafe_socks = 1; // (for now, warn every time) } - if (socks4_prot == socks4a && next+1 < buf->mem+buf->datalen) { + if (socks4_prot == socks4a) { + if (next+1 == buf->mem+buf->datalen) { + log_fn(LOG_DEBUG,"socks4: No part of destaddr here yet."); + return 0; + } startaddr = next+1; next = memchr(startaddr, 0, buf->mem+buf->datalen-startaddr); if (!next) { - log_fn(LOG_DEBUG,"socks4: Destaddr not here yet."); + log_fn(LOG_DEBUG,"socks4: Destaddr not all here yet."); return 0; } if (MAX_SOCKS_ADDR_LEN <= next-startaddr) { |