提交 896c1e65 编写于 作者: H Henry Rawas 提交者: JonathanPickett

Redis 2.6 for Windows

上级 19c476f4
!release
!debug
!release/*
!debug/*
......@@ -635,6 +635,9 @@ void freeClient(redisClient *c) {
* unblockClientWaitingData() to avoid processInputBuffer() will get
* called. Also it is important to remove the file events after
* this, because this call adds the READABLE event. */
#ifdef _WIN32
aeWinSocketDetach(c->fd, 1);
#endif
sdsfree(c->querybuf);
c->querybuf = NULL;
if (c->flags & REDIS_BLOCKED)
......
......@@ -41,7 +41,9 @@
#include <ctype.h>
#include <errno.h>
#include <sys/stat.h>
#ifndef _WIN32
#include <sys/time.h>
#endif
#include <assert.h>
#include <fcntl.h>
#ifdef _WIN32
......@@ -60,6 +62,21 @@
#include <limits.h>
#ifdef _WIN32
#include <fcntl.h>
#ifndef FD_SETSIZE
#define FD_SETSIZE 16000
#endif
#ifndef STDIN_FILENO
#define STDIN_FILENO (_fileno(stdin))
#endif
#include <winsock2.h>
#include <windows.h>
#include "win32fixes.h"
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define strtoull _strtoui64
#endif
#include "hiredis.h"
#include "sds.h"
......@@ -1121,7 +1138,7 @@ static void getRDB(void) {
while(payload) {
ssize_t nread, nwritten;
nread = read(s,buf,(payload > sizeof(buf)) ? sizeof(buf) : payload);
nread = read(s,buf,(unsigned int)(payload > sizeof(buf)) ? sizeof(buf) : payload);
if (nread <= 0) {
fprintf(stderr,"I/O Error reading RDB payload from socket\n");
exit(1);
......
......@@ -664,8 +664,8 @@ void activeExpireCycle(void) {
* 2) If last time we hit the time limit, we want to scan all DBs
* in this iteration, as there is work to do in some DB and we don't want
* expired keys to use memory for too much time. */
if (dbs_per_call > server.dbnum || timelimit_exit)
dbs_per_call = server.dbnum;
if (dbs_per_call > (unsigned)server.dbnum || timelimit_exit)
dbs_per_call = (unsigned)server.dbnum;
/* We can use at max REDIS_EXPIRELOOKUPS_TIME_PERC percentage of CPU time
* per iteration. Since this function gets called with a frequency of
......@@ -868,7 +868,7 @@ void databasesCron(void) {
unsigned int j;
/* Don't test more DBs than we have. */
if (dbs_per_call > server.dbnum) dbs_per_call = server.dbnum;
if (dbs_per_call > (unsigned)server.dbnum) dbs_per_call = server.dbnum;
/* Resize */
for (j = 0; j < dbs_per_call; j++) {
......
......@@ -438,6 +438,7 @@ void replicationAbortSyncTransfer(void) {
}
#else
close(server.repl_transfer_s);
#endif
close(server.repl_transfer_fd);
unlink(server.repl_transfer_tmpfile);
zfree(server.repl_transfer_tmpfile);
......
......@@ -60,9 +60,12 @@ start_server {tags {"protocol"}} {
assert_error "*wrong*arguments*ping*" {r ping x y z}
}
if { 0 == 1 } {
# not run in windows
set c 0
foreach seq [list "\x00" "*\x00" "$\x00"] {
incr c
after 10000
test "Protocol desync regression test #$c" {
set s [socket [srv 0 host] [srv 0 port]]
# windows - set nonblocking
......@@ -95,6 +98,7 @@ start_server {tags {"protocol"}} {
} {*Protocol error*}
}
unset c
}
}
start_server {tags {"regression"}} {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册