mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 12:19:02 +00:00
Style fixes
This commit is contained in:
@@ -158,6 +158,7 @@ static inline void socks4_data_init(struct socks4_data *socks4,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void handle_state_initial(mspool *nsp, msevent *nse, void *udata) {
|
static void handle_state_initial(mspool *nsp, msevent *nse, void *udata) {
|
||||||
|
struct proxy_chain_context *px_ctx = nse->iod->px_ctx;
|
||||||
struct sockaddr_storage *ss;
|
struct sockaddr_storage *ss;
|
||||||
size_t sslen;
|
size_t sslen;
|
||||||
unsigned short port;
|
unsigned short port;
|
||||||
@@ -165,17 +166,17 @@ static void handle_state_initial(mspool *nsp, msevent *nse, void *udata) {
|
|||||||
struct socks4_data socks4;
|
struct socks4_data socks4;
|
||||||
int timeout;
|
int timeout;
|
||||||
|
|
||||||
nse->iod->px_ctx->px_state = PROXY_STATE_SOCKS4_TCP_CONNECTED;
|
px_ctx->px_state = PROXY_STATE_SOCKS4_TCP_CONNECTED;
|
||||||
|
|
||||||
next = proxy_ctx_node_next(nse->iod->px_ctx);
|
next = proxy_ctx_node_next(px_ctx);
|
||||||
if (next) {
|
if (next) {
|
||||||
ss = &next->ss;
|
ss = &next->ss;
|
||||||
sslen = next->sslen;
|
sslen = next->sslen;
|
||||||
port = next->port;
|
port = next->port;
|
||||||
} else {
|
} else {
|
||||||
ss = &nse->iod->px_ctx->target_ss;
|
ss = &px_ctx->target_ss;
|
||||||
sslen = nse->iod->px_ctx->target_sslen;
|
sslen = px_ctx->target_sslen;
|
||||||
port = nse->iod->px_ctx->target_port;
|
port = px_ctx->target_port;
|
||||||
}
|
}
|
||||||
|
|
||||||
socks4_data_init(&socks4, ss, sslen, port);
|
socks4_data_init(&socks4, ss, sslen, port);
|
||||||
@@ -190,6 +191,7 @@ static void handle_state_initial(mspool *nsp, msevent *nse, void *udata) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void handle_state_tcp_connected(mspool *nsp, msevent *nse, void *udata) {
|
static void handle_state_tcp_connected(mspool *nsp, msevent *nse, void *udata) {
|
||||||
|
struct proxy_chain_context *px_ctx = nse->iod->px_ctx;
|
||||||
char *res;
|
char *res;
|
||||||
int reslen;
|
int reslen;
|
||||||
|
|
||||||
@@ -198,19 +200,19 @@ static void handle_state_tcp_connected(mspool *nsp, msevent *nse, void *udata) {
|
|||||||
if (!(reslen == 8 && res[1] == 90)) {
|
if (!(reslen == 8 && res[1] == 90)) {
|
||||||
struct proxy_node *node;
|
struct proxy_node *node;
|
||||||
|
|
||||||
node = proxy_ctx_node_current(nse->iod->px_ctx);
|
node = proxy_ctx_node_current(px_ctx);
|
||||||
nsock_log_debug(nsp, "Ignoring invalid socks4 reply from proxy %s",
|
nsock_log_debug(nsp, "Ignoring invalid socks4 reply from proxy %s",
|
||||||
node->nodestr);
|
node->nodestr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nse->iod->px_ctx->px_state = PROXY_STATE_SOCKS4_TUNNEL_ESTABLISHED;
|
px_ctx->px_state = PROXY_STATE_SOCKS4_TUNNEL_ESTABLISHED;
|
||||||
|
|
||||||
if (nse->iod->px_ctx->px_current->next == NULL) {
|
if (px_ctx->px_current->next == NULL) {
|
||||||
forward_event(nsp, nse, udata);
|
forward_event(nsp, nse, udata);
|
||||||
} else {
|
} else {
|
||||||
nse->iod->px_ctx->px_current = nse->iod->px_ctx->px_current->next;
|
px_ctx->px_current = px_ctx->px_current->next;
|
||||||
nse->iod->px_ctx->px_state = PROXY_STATE_INITIAL;
|
px_ctx->px_state = PROXY_STATE_INITIAL;
|
||||||
nsock_proxy_ev_dispatch(nsp, nse, udata);
|
nsock_proxy_ev_dispatch(nsp, nse, udata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user