]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Wrong length was causing spurious \0 to be sent during SSH negotiation with
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Sun, 8 Dec 2002 15:32:40 +0000 (15:32 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Sun, 8 Dec 2002 15:32:40 +0000 (15:32 +0000)
HTTP proxy -- fixed. (Also added a "len -= eol" to HTTP header munching,
although it has no practical effect.) HTTP proxying now works again, hurrah.

[originally from svn r2292]

proxy.c

diff --git a/proxy.c b/proxy.c
index c1aab15f2880c908211e8c7c0a43a686d7e0c03f..d1f842d682236677f67c3e880feca766cb2f1f5f 100644 (file)
--- a/proxy.c
+++ b/proxy.c
@@ -481,7 +481,7 @@ int proxy_http_negotiate (Proxy_Socket p, int change)
            sk_write(p->sub_socket, buf2, strlen(buf2));
        }
 
-       sk_write(p->sub_socket, "\r\n", strlen(buf));
+       sk_write(p->sub_socket, "\r\n", 2);
 
        p->state = 1;
        return 0;
@@ -594,6 +594,7 @@ int proxy_http_negotiate (Proxy_Socket p, int change)
            {
                bufchain_consume(&p->pending_input_data, eol);
                datap += eol;
+               len   -= eol;
                eol = get_line_end(datap, len);
            }