This commit fixes the problem reported by:
https://github.com/MSOpenTech/redis/issues/304https://github.com/MSOpenTech/redis/issues/306
A previous commit that fixed a socketstate leak exposed another existing bug:
if FDAPI_AcceptEx() fails the socketstate is accessed after the socket has
already been closed and the socketstate memory has been released, causing
a heap corruption exception .
[Fix] Improved error handlingin WSIOCP_Listen().
Renamed functions and variable, removed unused code, changed API replacement
for WSA functions:
- Changed the aeWin prefix to WSAIOCP_.
- Changed WSA functions from been remapped to be named with the FDAPI_ prefix.
- Removed unused API replacements.
Changed comments.
Code formatting.
Redesigned the way the socket state is managed.
The socket state was saved in a dedicated linked list in the aeApiState
structure, the list has been removed and the socket state is saved along
the socket descriptor in RFDMap::RFDToSocketInfoMap.
The socket state methods (get and delete) have been moved out from the
ae_wsiocp.c file and put in win32_wsiocp.c.
Some functions have been renamed to match the actual functionality.
In a master-slave configuration, if the master has AUTH on and the slave
connects without AUTH, after every slave attempt to connect, the master
doesn't close the client connection and will eventually reach the maxclients
limit.
"SocketState" was used to indicate the socket flags, renamed ahead of moving the
SocketState from the aeApiState structure to the socket map in the RFDMap class.
This commit fixes https://github.com/MSOpenTech/redis/issues/275
Credits to @ppanyukov for investigating the bug.
An existing fix was not working in Release mode because the compiler
optimization was removing the code that forces the VEH to map the memory page.
Conflicts:
src/Win32_Interop/Win32_fdapi_crt.cpp
src/Win32_Interop/Win32_fdapi_crt.h
[Change] Updated the ReleasePackagingTool to include all .pdb files.
[Change] Updated the nuget/chocolatey templates to conform with the guidelines:
- Replaced the Redis logo with the Redis icon.
- Changed the package title.
- Changed the package description.
- Removed the package summary to use a short version of the decription
instead.
[Change] Updated license.txt to 2015.
[Fix] If an exception occured while building the server info data, the footer
was not logged.
[Fix] Uncommented the ServerInfo() call that was commented out by mistake in a
previous commit.