# HG changeset patch # User Matti Hamalainen # Date 1403394513 -10800 # Node ID c8584cf52c98b79b8b9da1aa61a28ed472bf92f5 # Parent 452adc41ccf59752fd11dfc478f1502d6c3dcbe0 Various bugfixes in proxy handling. diff -r 452adc41ccf5 -r c8584cf52c98 th_network.c --- 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; }