#define do_proxy_dns(cfg) \
(cfg->proxy_dns == FORCE_ON || \
- (cfg->proxy_dns == AUTO && cfg->proxy_type != PROXY_SOCKS))
+ (cfg->proxy_dns == AUTO && \
+ cfg->proxy_type != PROXY_SOCKS4 && \
+ cfg->proxy_type != PROXY_SOCKS5))
/*
* Call this when proxy negotiation is complete, so that this
plug_sent(ps->plug, bufsize);
}
-static int plug_proxy_accepting (Plug p, void *sock)
+static int plug_proxy_accepting (Plug p, OSSocket sock)
{
Proxy_Plug pp = (Proxy_Plug) p;
Proxy_Socket ps = pp->proxy_socket;
* match (ie. a specific IP)
*/
- if (addr && stricmp(hostip, exclude_list + s) == 0)
+ if (addr && strnicmp(hostip, exclude_list + s, e - s) == 0)
return 0; /* IP/hostname excluded. do not use proxy. */
- if (stricmp(hostname, exclude_list + s) == 0)
+ if (strnicmp(hostname, exclude_list + s, e - s) == 0)
return 0; /* IP/hostname excluded. do not use proxy. */
}
return sk_namelookup(host, canonicalname);
}
-Socket platform_new_connection(SockAddr addr, char *hostname,
- int port, int privport,
- int oobinline, int nodelay, Plug plug,
- const Config *cfg);
-
Socket new_connection(SockAddr addr, char *hostname,
int port, int privport,
int oobinline, int nodelay, Plug plug,
char *proxy_canonical_name;
Socket sret;
- if ( (sret = platform_new_connection(addr, hostname, port, privport,
- oobinline, nodelay, plug, cfg)) )
+ if ((sret = platform_new_connection(addr, hostname, port, privport,
+ oobinline, nodelay, plug, cfg)) !=
+ NULL)
return sret;
ret = snew(struct Socket_proxy_tag);
if (cfg->proxy_type == PROXY_HTTP) {
ret->negotiate = proxy_http_negotiate;
- } else if (cfg->proxy_type == PROXY_SOCKS) {
- if (cfg->proxy_socks_version == 4)
- ret->negotiate = proxy_socks4_negotiate;
- else
- ret->negotiate = proxy_socks5_negotiate;
+ } else if (cfg->proxy_type == PROXY_SOCKS4) {
+ ret->negotiate = proxy_socks4_negotiate;
+ } else if (cfg->proxy_type == PROXY_SOCKS5) {
+ ret->negotiate = proxy_socks5_negotiate;
} else if (cfg->proxy_type == PROXY_TELNET) {
ret->negotiate = proxy_telnet_negotiate;
} else {