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

Added IOCP integration for Nsock

This commit is contained in:
tudor
2016-08-09 12:44:55 +00:00
parent 3ba4a87c75
commit 1aa7958e23
11 changed files with 949 additions and 3 deletions

View File

@@ -64,6 +64,10 @@
#include <errno.h>
#include <string.h>
#if HAVE_IOCP
#include "nsock_iocp.h"
#endif
static int mksock_bind_addr(struct npool *ms, struct niod *iod) {
int rc;
@@ -252,6 +256,12 @@ void nsock_connect_internal(struct npool *ms, struct nevent *nse, int type, int
if (&iod->peer != ss)
memcpy(&iod->peer, ss, sslen);
iod->peerlen = sslen;
#if HAVE_IOCP
/* The connection will be initiated when the event is added to the iod. */
if (engine_is_iocp(ms))
return;
#endif
if (connect(iod->sd, (struct sockaddr *)ss, sslen) == -1) {
int err = socket_errno();