diff --git a/src/Win32_Interop/win32_wsiocp.c b/src/Win32_Interop/win32_wsiocp.c index e7c1b7a4..bfda3196 100644 --- a/src/Win32_Interop/win32_wsiocp.c +++ b/src/Win32_Interop/win32_wsiocp.c @@ -244,10 +244,10 @@ int WSIOCP_Accept(int fd, struct sockaddr *sa, socklen_t *len) { return acceptfd; } -/* After doing read caller needs to call done so that we can - * continue to check for read events. - * This is not necessary if caller will delete read events */ -int WSIOCP_ReceiveDone(int fd) { +/* After doing a read, the caller needs to call this method in + * order to continue to check for read events. + * This is not necessary if the caller will delete read events */ +int WSIOCP_QueueNextRead(int fd) { iocpSockState *sockstate; int result; WSABUF zreadbuf; diff --git a/src/Win32_Interop/win32_wsiocp2.h b/src/Win32_Interop/win32_wsiocp2.h index 71f1cd68..5983e1b2 100644 --- a/src/Win32_Interop/win32_wsiocp2.h +++ b/src/Win32_Interop/win32_wsiocp2.h @@ -34,7 +34,7 @@ typedef struct WSIOCP_Request { int len; } WSIOCP_Request; -int WSIOCP_ReceiveDone(int rfd); +int WSIOCP_QueueNextRead(int rfd); int WSIOCP_SocketSend(int rfd, char *buf, int len, void *eventLoop, void *client, void *data, void *proc); int WSIOCP_Listen(int rfd, int backlog); int WSIOCP_Accept(int rfd, struct sockaddr *sa, socklen_t *len); diff --git a/src/ae_wsiocp.c b/src/ae_wsiocp.c index de9fe743..6e1116e1 100644 --- a/src/ae_wsiocp.c +++ b/src/ae_wsiocp.c @@ -125,7 +125,7 @@ static int aeApiAddEvent(aeEventLoop *eventLoop, int fd, int mask) { } else { if ((sockstate->masks & READ_QUEUED) == 0) { // Queue up a 0 byte read - WSIOCP_ReceiveDone(fd); + WSIOCP_QueueNextRead(fd); } } } diff --git a/src/cluster.c b/src/cluster.c index 0d8eb072..65d3be8c 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -2080,7 +2080,7 @@ void clusterReadHandler(aeEventLoop *el, int fd, void *privdata, int mask) { } } WIN32_ONLY(done:) - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) } /* Put stuff into the send buffer. diff --git a/src/networking.c b/src/networking.c index b18f0202..7fc6917f 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1334,7 +1334,7 @@ void readQueryFromClient(aeEventLoop *el, int fd, void *privdata, int mask) { freeClient(c); return; } - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) if (nread) { sdsIncrLen(c->querybuf,nread); c->lastinteraction = server.unixtime; diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c index fbf7b568..1e115f12 100644 --- a/src/redis-benchmark.c +++ b/src/redis-benchmark.c @@ -226,7 +226,7 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) { if (nread == -1) { if ((errno == ENOENT) || (errno == WSAEWOULDBLOCK)) { errno = EAGAIN; - WSIOCP_ReceiveDone((int) c->context->fd); + WSIOCP_QueueNextRead((int) c->context->fd); return; } else { fprintf(stderr,"Error: %s\n",c->context->errstr); @@ -239,7 +239,7 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) { fprintf(stderr,"Error: %s\n",c->context->errstr); exit(1); } else { - WIN32_ONLY(WSIOCP_ReceiveDone((int) c->context->fd);) + WIN32_ONLY(WSIOCP_QueueNextRead((int) c->context->fd);) while(c->pending) { if (redisGetReply(c->context,&reply) != REDIS_OK) { fprintf(stderr,"Error: %s\n",c->context->errstr); diff --git a/src/replication.c b/src/replication.c index d85344c7..542608e4 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1086,7 +1086,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) { goto error; } - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) if (buf[0] == '-') { redisLog(REDIS_WARNING, @@ -1156,7 +1156,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) { replicationAbortSyncTransfer(); return; } - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) server.stat_net_input_bytes += nread; /* When a mark is used, we want to detect EOF asap in order to avoid @@ -1421,7 +1421,7 @@ int slaveTryPartialResynchronization(int fd, int read_reply) { aeDeleteFileEvent(server.el,fd,AE_READABLE); return PSYNC_WRITE_ERROR; } - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) return PSYNC_WAIT_REPLY; } @@ -1431,7 +1431,7 @@ int slaveTryPartialResynchronization(int fd, int read_reply) { /* The master may send empty newlines after it receives PSYNC * and before to reply, just to keep the connection alive. */ sdsfree(reply); - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) return PSYNC_WAIT_REPLY; } @@ -1533,7 +1533,7 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) { * that will take care about this. */ err = sendSynchronousCommand(SYNC_CMD_WRITE,fd,"PING",NULL); if (err) goto write_error; - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) return; } @@ -1557,7 +1557,7 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) { redisLog(REDIS_NOTICE, "Master replied to PING, replication can continue..."); } - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) sdsfree(err); server.repl_state = REDIS_REPL_SEND_AUTH; } diff --git a/src/sentinel.c b/src/sentinel.c index bbe637e9..3e817bca 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -258,7 +258,7 @@ static void redisAeReadEvent(aeEventLoop *el, int fd, void *privdata, int mask) ((void)el); ((void)fd); ((void)mask); redisAsyncHandleRead(e->context); - WIN32_ONLY(WSIOCP_ReceiveDone(fd);) + WIN32_ONLY(WSIOCP_QueueNextRead(fd);) } #ifdef _WIN32