[Code cleanup] Renamed WSIOCP_ReceiveDone to WSIOCP_QueueNextRead.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
+6
-6
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user