X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=proxy.c;h=5baab7a8ed86d42bbd577564a39a2050ee7ec538;hb=b21e8ac60bac296a572a4b96fed3b09c07a98499;hp=f21c17b5b697cdb589ea8cfe4815f48fe26e9cbd;hpb=6daf6faede46bd8aa3a39cbe59d34c987b2ea114;p=PuTTY.git diff --git a/proxy.c b/proxy.c index f21c17b5..5baab7a8 100644 --- a/proxy.c +++ b/proxy.c @@ -1315,7 +1315,8 @@ char *format_telnet_command(SockAddr addr, int port, const Config *cfg) } else { /* % escape. we recognize %%, %host, %port, %user, %pass. - * anything else, we just send unescaped (including the %). + * %proxyhost, %proxyport. Anything else we just send + * unescaped (including the %). */ if (cfg->proxy_telnet_command[eo] == '%') { @@ -1359,6 +1360,25 @@ char *format_telnet_command(SockAddr addr, int port, const Config *cfg) retlen += passlen; eo += 4; } + else if (strnicmp(cfg->proxy_telnet_command + eo, + "proxyhost", 4) == 0) { + int phlen = strlen(cfg->proxy_host); + ENSURE(phlen); + memcpy(ret+retlen, cfg->proxy_host, phlen); + retlen += phlen; + eo += 9; + } + else if (strnicmp(cfg->proxy_telnet_command + eo, + "proxyport", 4) == 0) { + char pport[50]; + int pplen; + sprintf(pport, "%d", cfg->proxy_port); + pplen = strlen(cfg->proxy_host); + ENSURE(pplen); + memcpy(ret+retlen, pport, pplen); + retlen += pplen; + eo += 9; + } else { /* we don't escape this, so send the % now, and * don't advance eo, so that we'll consider the