Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hanoi2005
redis
提交
e1f6d21c
R
redis
项目概览
hanoi2005
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e1f6d21c
编写于
10月 09, 2013
作者:
J
Jonathan Pickett
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stability fixes
上级
7071e9d5
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
72 addition
and
40 deletion
+72
-40
deps/hiredis/hiredis.c
deps/hiredis/hiredis.c
+2
-1
deps/hiredis/net.c
deps/hiredis/net.c
+6
-1
msvs/RedisBenchmark/RedisBenchmark.vcxproj
msvs/RedisBenchmark/RedisBenchmark.vcxproj
+4
-4
msvs/RedisCheckAof/RedisCheckAof.vcxproj
msvs/RedisCheckAof/RedisCheckAof.vcxproj
+4
-4
msvs/RedisCheckDump/RedisCheckDump.vcxproj
msvs/RedisCheckDump/RedisCheckDump.vcxproj
+4
-4
msvs/RedisCli/RedisCli.vcxproj
msvs/RedisCli/RedisCli.vcxproj
+4
-4
msvs/RedisServer.vcxproj
msvs/RedisServer.vcxproj
+4
-4
msvs/hiredis/hiredis.vcxproj
msvs/hiredis/hiredis.vcxproj
+4
-4
msvs/lua/lua/lua.vcxproj
msvs/lua/lua/lua.vcxproj
+4
-4
src/ae_wsiocp.c
src/ae_wsiocp.c
+3
-5
src/rdb.c
src/rdb.c
+23
-4
src/sentinel.c
src/sentinel.c
+6
-0
src/win32_wsiocp.c
src/win32_wsiocp.c
+4
-1
未找到文件。
deps/hiredis/hiredis.c
浏览文件 @
e1f6d21c
...
...
@@ -1023,13 +1023,14 @@ static redisContext *redisContextInit(void) {
}
void
redisFree
(
redisContext
*
c
)
{
if
(
c
->
fd
>
0
)
if
(
c
->
fd
>
0
)
{
#ifdef _WIN32
closesocket
(
c
->
fd
);
smRemoveSocket
(
c
->
fd
);
#else
close
(
c
->
fd
);
#endif
}
if
(
c
->
obuf
!=
NULL
)
sdsfree
(
c
->
obuf
);
if
(
c
->
reader
!=
NULL
)
...
...
deps/hiredis/net.c
浏览文件 @
e1f6d21c
...
...
@@ -367,8 +367,13 @@ int redisContextPreConnectTcp(redisContext *c, const char *addr, int port,
int
blocking
=
(
c
->
flags
&
REDIS_BLOCK
);
unsigned
long
inAddress
;
if
((
s
=
redisCreateSocket
(
c
,
AF_INET
))
<
0
)
if
((
s
=
redisCreateSocket
(
c
,
AF_INET
))
<
0
)
{
return
REDIS_ERR
;
}
else
{
smAddSocket
(
s
);
}
sa
->
sin_family
=
AF_INET
;
sa
->
sin_port
=
htons
(
port
);
...
...
msvs/RedisBenchmark/RedisBenchmark.vcxproj
浏览文件 @
e1f6d21c
...
...
@@ -90,7 +90,7 @@
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
_WIN32IOCP;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\hiredis;
</AdditionalIncludeDirectories>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -108,7 +108,7 @@
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
_WIN32IOCP;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\hiredis;
</AdditionalIncludeDirectories>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -128,7 +128,7 @@
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
_WIN32IOCP;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\hiredis;
</AdditionalIncludeDirectories>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -150,7 +150,7 @@
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
_WIN32IOCP;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\hiredis;
</AdditionalIncludeDirectories>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
msvs/RedisCheckAof/RedisCheckAof.vcxproj
浏览文件 @
e1f6d21c
...
...
@@ -83,7 +83,7 @@
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
...
...
@@ -97,7 +97,7 @@
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
...
...
@@ -113,7 +113,7 @@
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
WIN32;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
...
...
@@ -131,7 +131,7 @@
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
WIN32;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
...
...
msvs/RedisCheckDump/RedisCheckDump.vcxproj
浏览文件 @
e1f6d21c
...
...
@@ -82,7 +82,7 @@
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -96,7 +96,7 @@
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -112,7 +112,7 @@
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -130,7 +130,7 @@
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
msvs/RedisCli/RedisCli.vcxproj
浏览文件 @
e1f6d21c
...
...
@@ -83,7 +83,7 @@
<Optimization>
Disabled
</Optimization>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\hiredis;$(SolutionDir)..\deps\linenoise
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -99,7 +99,7 @@
<Optimization>
Disabled
</Optimization>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\hiredis;$(SolutionDir)..\deps\linenoise
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -117,7 +117,7 @@
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\hiredis;$(SolutionDir)..\deps\linenoise
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>
WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -137,7 +137,7 @@
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\hiredis;$(SolutionDir)..\deps\linenoise
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>
WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
msvs/RedisServer.vcxproj
浏览文件 @
e1f6d21c
...
...
@@ -83,7 +83,7 @@
<ClCompile>
<PreprocessorDefinitions>
_WIN32IOCP;WIN32;_DEBUG;_CONSOLE;__x86_64__;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\lua\src;$(SolutionDir)..\deps\hiredis
</AdditionalIncludeDirectories>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<WarningLevel>
Level3
</WarningLevel>
<DebugInformationFormat>
ProgramDatabase
</DebugInformationFormat>
<Optimization>
Disabled
</Optimization>
...
...
@@ -101,7 +101,7 @@
<ClCompile>
<PreprocessorDefinitions>
_WIN32IOCP;WIN32;_DEBUG;_CONSOLE;__x86_64__;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\lua\src;$(SolutionDir)..\deps\hiredis
</AdditionalIncludeDirectories>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<WarningLevel>
Level3
</WarningLevel>
<DebugInformationFormat>
ProgramDatabase
</DebugInformationFormat>
<Optimization>
Disabled
</Optimization>
...
...
@@ -118,7 +118,7 @@
<ClCompile>
<PreprocessorDefinitions>
_WIN32IOCP;WIN32;NDEBUG;_CONSOLE;__x86_64__;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\lua\src;$(SolutionDir)..\deps\hiredis
</AdditionalIncludeDirectories>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<WarningLevel>
Level3
</WarningLevel>
<DebugInformationFormat>
ProgramDatabase
</DebugInformationFormat>
<DisableSpecificWarnings>
4996;4146
</DisableSpecificWarnings>
...
...
@@ -137,7 +137,7 @@
<ClCompile>
<PreprocessorDefinitions>
_WIN32IOCP;WIN32;NDEBUG;_CONSOLE;__x86_64__;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
$(SolutionDir)..\deps\lua\src;$(SolutionDir)..\deps\hiredis
</AdditionalIncludeDirectories>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<WarningLevel>
Level3
</WarningLevel>
<DebugInformationFormat>
ProgramDatabase
</DebugInformationFormat>
<DisableSpecificWarnings>
4996;4146
</DisableSpecificWarnings>
...
...
msvs/hiredis/hiredis.vcxproj
浏览文件 @
e1f6d21c
...
...
@@ -84,7 +84,7 @@
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -98,7 +98,7 @@
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -114,7 +114,7 @@
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
WIN32;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -132,7 +132,7 @@
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
WIN32;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4996
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
msvs/lua/lua/lua.vcxproj
浏览文件 @
e1f6d21c
...
...
@@ -91,7 +91,7 @@
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<PrecompiledHeader>
NotUsing
</PrecompiledHeader>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4244;4018
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -106,7 +106,7 @@
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<PrecompiledHeader>
NotUsing
</PrecompiledHeader>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreadedDebug
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4244;4018
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -120,7 +120,7 @@
<WarningLevel>
Level3
</WarningLevel>
<PreprocessorDefinitions>
WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<PrecompiledHeader>
NotUsing
</PrecompiledHeader>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4244;4018
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
@@ -134,7 +134,7 @@
<WarningLevel>
Level3
</WarningLevel>
<PreprocessorDefinitions>
WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<PrecompiledHeader>
NotUsing
</PrecompiledHeader>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<RuntimeLibrary>
MultiThreaded
DLL
</RuntimeLibrary>
<DisableSpecificWarnings>
4244;4018
</DisableSpecificWarnings>
</ClCompile>
<Link>
...
...
src/ae_wsiocp.c
浏览文件 @
e1f6d21c
...
...
@@ -53,8 +53,7 @@ sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx;
* socket value is not an index. Convert socket to index
* and then find matching structure in list */
/* prefer prime number for number of indexes */
#define MAX_SOCKET_LOOKUP 1021
#define MAX_SOCKET_LOOKUP 65535
/* structure that keeps state of sockets and Completion port handle */
typedef
struct
aeApiState
{
...
...
@@ -65,10 +64,9 @@ typedef struct aeApiState {
list
closing
;
}
aeApiState
;
/* convert socket value to an index
* Use simple modulo. We can add hash if needed */
/* uses virtual FD as an index */
int
aeSocketIndex
(
int
fd
)
{
return
fd
%
MAX_SOCKET_LOOKUP
;
return
smLookupFD
(
fd
)
;
}
/* get data for socket / fd being monitored. Create if not found*/
...
...
src/rdb.c
浏览文件 @
e1f6d21c
...
...
@@ -39,6 +39,8 @@
#include <sys/resource.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#else
#include <stdio.h>
#endif
#include <sys/stat.h>
...
...
@@ -414,6 +416,11 @@ int rdbSaveDoubleValue(rio *rdb, double val) {
int
rdbLoadDoubleValue
(
rio
*
rdb
,
double
*
val
)
{
char
buf
[
128
];
unsigned
char
len
;
#ifdef _WIN32
double
scannedVal
=
0
;
int
assigned
=
0
;
memset
(
buf
,
128
,
0
);
#endif
if
(
rioRead
(
rdb
,
&
len
,
1
)
==
0
)
return
-
1
;
switch
(
len
)
{
...
...
@@ -423,8 +430,18 @@ int rdbLoadDoubleValue(rio *rdb, double *val) {
default:
if
(
rioRead
(
rdb
,
buf
,
len
)
==
0
)
return
-
1
;
buf
[
len
]
=
'\0'
;
#ifdef _WIN32
assigned
=
sscanf_s
(
buf
,
"%lg"
,
&
scannedVal
);
if
(
assigned
!=
0
)
{
(
*
val
)
=
scannedVal
;
return
0
;
}
else
{
return
-
1
;
}
#else
sscanf
(
buf
,
"%lg"
,
val
);
return
0
;
#endif
}
}
...
...
@@ -1338,13 +1355,15 @@ void stopLoading(void) {
}
int
rdbLoad
(
char
*
filename
)
{
uint32_t
dbid
;
int
type
,
rdbver
;
uint32_t
dbid
=
0
;
int
type
=
0
;
int
rdbver
=
0
;
redisDb
*
db
=
server
.
db
+
0
;
char
buf
[
1024
];
long
long
expiretime
,
now
=
mstime
();
long
long
expiretime
;
long
now
=
mstime
();
long
loops
=
0
;
FILE
*
fp
;
FILE
*
fp
=
NULL
;
rio
rdb
;
#ifdef _WIN32
...
...
src/sentinel.c
浏览文件 @
e1f6d21c
...
...
@@ -39,7 +39,9 @@
#include <sys/wait.h>
#endif
#ifndef _WIN32
extern
char
**
environ
;
#endif
#define REDIS_SENTINEL_PORT 26379
...
...
@@ -671,7 +673,11 @@ void sentinelRunPendingScripts(void) {
sj
->
pid
=
0
;
}
else
if
(
pid
==
0
)
{
/* Child */
#ifdef _WIN32
_execv
(
sj
->
argv
[
0
],
sj
->
argv
);
#else
execve
(
sj
->
argv
[
0
],
sj
->
argv
,
environ
);
#endif
/* If we are here an error occurred. */
_exit
(
2
);
/* Don't retry execution. */
}
else
{
...
...
src/win32_wsiocp.c
浏览文件 @
e1f6d21c
...
...
@@ -442,6 +442,7 @@ void aeShutdown(int fd) {
/* when closing socket, need to unassociate completion port */
int
aeWinCloseSocket
(
int
fd
)
{
aeSockState
*
sockstate
;
BOOL
closed
=
FALSE
;
if
((
sockstate
=
aeGetSockState
(
iocpState
,
fd
))
==
NULL
)
{
closesocket
((
SOCKET
)
fd
);
...
...
@@ -455,12 +456,14 @@ int aeWinCloseSocket(int fd) {
if
(
sockstate
->
wreqs
==
0
&&
(
sockstate
->
masks
&
(
READ_QUEUED
|
CONNECT_PENDING
|
SOCKET_ATTACHED
))
==
0
)
{
closesocket
((
SOCKET
)
fd
);
smRemoveSocket
(
fd
)
;
closed
=
TRUE
;
}
else
{
sockstate
->
masks
|=
CLOSE_PENDING
;
}
aeDelSockState
(
iocpState
,
sockstate
);
if
(
closed
==
TRUE
)
smRemoveSocket
(
fd
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录