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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user