1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 14:39:02 +00:00

Removed the proxy-specific tcp_connect hook.

This simplifies the interface that proxies export to the library but also relies
upon the assumption that a proxy chain starts with a TCP connection from the
scanner to the next hop proxy. That will be enough ATM.
This commit is contained in:
henri
2013-04-22 19:31:40 +00:00
parent 4d5bb41361
commit ba27c10458
3 changed files with 12 additions and 28 deletions

View File

@@ -270,7 +270,18 @@ nsock_event_id nsock_connect_tcp(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_hand
current = PROXY_CTX_CURRENT(nsi->px_ctx);
assert(current != NULL);
return current->ops->connect_tcp(nsp, ms_iod, handler, timeout_msecs, userdata, saddr, sslen, port);
memcpy(&nsi->px_ctx->target_ss, saddr, sslen);
nsi->px_ctx->target_sslen = sslen;
nsi->px_ctx->target_port = port;
nsi->px_ctx->target_handler = handler;
saddr = (struct sockaddr *)&current->ss;
sslen = current->sslen;
port = current->port;
handler = nsock_proxy_ev_dispatch;
return nsock_connect_tcp_direct(nsp, ms_iod, handler, timeout_msecs, userdata, saddr, sslen, port);
}
return nsock_connect_tcp_direct(nsp, ms_iod, handler, timeout_msecs, userdata, saddr, sslen, port);