mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Make SSH proxying conditional on CONF_proxy_type!
In commit 0d3bb73608
, I introduced the new SSH / jump-host proxy
type, which should be invoked by proxy.c when CONF_proxy_type is set
to PROXY_SSH. In fact, I left out the check, so it's invoked by
proxy.c _unconditionally_, after the check to see whether proxying is
required at all. So any saved session configured with any other proxy
type (other than PROXY_NONE) would be treated as PROXY_SSH by mistake.
How embarrassing. I did remember at one point that I needed to fix
this, but it fell out of my head before I pushed!
This commit is contained in:
parent
d008d235f3
commit
415927e9b0
9
proxy.c
9
proxy.c
@ -395,7 +395,9 @@ Socket *new_connection(SockAddr *addr, const char *hostname,
|
|||||||
bool oobinline, bool nodelay, bool keepalive,
|
bool oobinline, bool nodelay, bool keepalive,
|
||||||
Plug *plug, Conf *conf)
|
Plug *plug, Conf *conf)
|
||||||
{
|
{
|
||||||
if (conf_get_int(conf, CONF_proxy_type) != PROXY_NONE &&
|
int type = conf_get_int(conf, CONF_proxy_type);
|
||||||
|
|
||||||
|
if (type != PROXY_NONE &&
|
||||||
proxy_for_destination(addr, hostname, port, conf))
|
proxy_for_destination(addr, hostname, port, conf))
|
||||||
{
|
{
|
||||||
ProxySocket *ret;
|
ProxySocket *ret;
|
||||||
@ -403,9 +405,9 @@ Socket *new_connection(SockAddr *addr, const char *hostname,
|
|||||||
char *proxy_canonical_name;
|
char *proxy_canonical_name;
|
||||||
const char *proxy_type;
|
const char *proxy_type;
|
||||||
Socket *sret;
|
Socket *sret;
|
||||||
int type;
|
|
||||||
|
|
||||||
if ((sret = sshproxy_new_connection(addr, hostname, port, privport,
|
if (type == PROXY_SSH &&
|
||||||
|
(sret = sshproxy_new_connection(addr, hostname, port, privport,
|
||||||
oobinline, nodelay, keepalive,
|
oobinline, nodelay, keepalive,
|
||||||
plug, conf)) != NULL)
|
plug, conf)) != NULL)
|
||||||
return sret;
|
return sret;
|
||||||
@ -435,7 +437,6 @@ Socket *new_connection(SockAddr *addr, const char *hostname,
|
|||||||
ret->state = PROXY_STATE_NEW;
|
ret->state = PROXY_STATE_NEW;
|
||||||
ret->negotiate = NULL;
|
ret->negotiate = NULL;
|
||||||
|
|
||||||
type = conf_get_int(conf, CONF_proxy_type);
|
|
||||||
if (type == PROXY_HTTP) {
|
if (type == PROXY_HTTP) {
|
||||||
ret->negotiate = proxy_http_negotiate;
|
ret->negotiate = proxy_http_negotiate;
|
||||||
proxy_type = "HTTP";
|
proxy_type = "HTTP";
|
||||||
|
Loading…
Reference in New Issue
Block a user