changeset 123:c8584cf52c98

Various bugfixes in proxy handling.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 22 Jun 2014 02:48:33 +0300
parents 452adc41ccf5
children 61d882a9758b
files th_network.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/th_network.c	Sun Jun 22 02:45:06 2014 +0300
+++ b/th_network.c	Sun Jun 22 02:48:33 2014 +0300
@@ -309,7 +309,7 @@
 
     th_growbuf_puts(&buf, conn->proxy.userid, TRUE);
     if (conn->proxy.addr_type == TH_PROXY_ADDR_DOMAIN)
-        th_growbuf_puts(&buf, conn->host, TRUE);
+        th_growbuf_puts(&buf, host, TRUE);
 
     // Send request
     if ((err = th_conn_proxy_send(conn, &buf)) != THERR_OK)
@@ -490,11 +490,11 @@
         goto out;
     }
 
-#if 1
+
     // Form client connection request packet
     th_growbuf_clear(&buf);
     th_growbuf_put_u8(&buf, 0x05); // Protocol version
-    th_growbuf_put_u8(&buf, cmd); // Command
+    th_growbuf_put_u8(&buf, cmd);  // Command
     th_growbuf_put_u8(&buf, 0x00); // Reserved
 
     switch (conn->proxy.addr_type)
@@ -510,7 +510,7 @@
             break;
         
         case TH_PROXY_ADDR_DOMAIN:
-            cmd = strlen(conn->host);
+            cmd = strlen(host);
             if (cmd < 1 || cmd > 255)
             {
                 err = THERR_NOT_SUPPORTED;
@@ -521,7 +521,7 @@
 
             th_growbuf_put_u8(&buf, SOCKS5_ADDR_DOMAIN);
             th_growbuf_put_u8(&buf, cmd);
-            th_growbuf_put_str(&buf, conn->host, cmd);
+            th_growbuf_put_str(&buf, host, cmd);
             break;
     }