X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/90f2ed42275289be8b7b178d5f5b91e5f05fccfd..c1b71b1c52473fefe61d9263689ce423ec6d4818:/unix/uxproxy.c diff --git a/unix/uxproxy.c b/unix/uxproxy.c index f4e67589..b441b802 100644 --- a/unix/uxproxy.c +++ b/unix/uxproxy.c @@ -209,7 +209,7 @@ static int localproxy_select_result(int fd, int event) } else if (ret == 0) { return plug_closing(s->plug, NULL, 0, 0); } else { - return plug_receive(s->plug, 1, buf, ret); + return plug_receive(s->plug, 0, buf, ret); } } else if (event == 2) { assert(fd == s->to_cmd); @@ -224,7 +224,7 @@ static int localproxy_select_result(int fd, int event) Socket platform_new_connection(SockAddr addr, char *hostname, int port, int privport, int oobinline, int nodelay, int keepalive, - Plug plug, const Config *cfg) + Plug plug, Conf *conf) { char *cmd; @@ -243,10 +243,10 @@ Socket platform_new_connection(SockAddr addr, char *hostname, Local_Proxy_Socket ret; int to_cmd_pipe[2], from_cmd_pipe[2], pid; - if (cfg->proxy_type != PROXY_CMD) + if (conf_get_int(conf, CONF_proxy_type) != PROXY_CMD) return NULL; - cmd = format_telnet_command(addr, port, cfg); + cmd = format_telnet_command(addr, port, conf); ret = snew(struct Socket_localproxy_tag); ret->fn = &socket_fn_table; @@ -286,6 +286,8 @@ Socket platform_new_connection(SockAddr addr, char *hostname, _exit(255); } + sfree(cmd); + close(to_cmd_pipe[0]); close(from_cmd_pipe[1]);