acl 3.0.22 版本发布

This commit is contained in:
zsxxsz 2014-12-14 23:27:32 +08:00
parent 9077ac9790
commit 89b5fbc932
28 changed files with 543 additions and 77 deletions

View File

@ -266,6 +266,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples_protocol", "samples
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi", "lib_acl_cpp\samples\cgi\cgi_vc2012.vcxproj", "{2C2212C1-01D2-4C8E-AB15-F7E31C7C134B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aio_server_ssl", "lib_acl_cpp\samples\aio\aio_server_ssl\aio_server_ssl_vc2012.vcxproj", "{A07145B7-36AE-4D6F-8536-30A8BE48529D}"
ProjectSection(ProjectDependencies) = postProject
{6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC}
{B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B}
{FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aio_client_ssl", "lib_acl_cpp\samples\aio\aio_client_ssl\aio_client_ssl_vc2012.vcxproj", "{95F01BE0-DD1D-4671-8C22-BD420917401B}"
ProjectSection(ProjectDependencies) = postProject
{6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC} = {6EC1F44E-6A6A-48E9-B699-D7E89B63C8DC}
{B40213C2-507C-4C7F-A6E1-B850C9BDC27B} = {B40213C2-507C-4C7F-A6E1-B850C9BDC27B}
{FE724EF7-3763-4E78-BDF5-BCBC075719FD} = {FE724EF7-3763-4E78-BDF5-BCBC075719FD}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -970,6 +984,36 @@ Global
{2C2212C1-01D2-4C8E-AB15-F7E31C7C134B}.Template|Win32.ActiveCfg = DebugDll|Win32
{2C2212C1-01D2-4C8E-AB15-F7E31C7C134B}.Template|Win32.Build.0 = DebugDll|Win32
{2C2212C1-01D2-4C8E-AB15-F7E31C7C134B}.Template|x64.ActiveCfg = DebugDll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Debug|Win32.ActiveCfg = Debug|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Debug|Win32.Build.0 = Debug|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Debug|x64.ActiveCfg = Debug|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.DebugDll|Win32.Build.0 = DebugDll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.DebugDll|x64.ActiveCfg = DebugDll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Release|Win32.ActiveCfg = Release|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Release|Win32.Build.0 = Release|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Release|x64.ActiveCfg = Release|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Releasedll|Win32.ActiveCfg = Releasedll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Releasedll|Win32.Build.0 = Releasedll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Releasedll|x64.ActiveCfg = Releasedll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Template|Win32.ActiveCfg = DebugDll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Template|Win32.Build.0 = DebugDll|Win32
{A07145B7-36AE-4D6F-8536-30A8BE48529D}.Template|x64.ActiveCfg = DebugDll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Debug|Win32.ActiveCfg = Debug|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Debug|Win32.Build.0 = Debug|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Debug|x64.ActiveCfg = Debug|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.DebugDll|Win32.Build.0 = DebugDll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.DebugDll|x64.ActiveCfg = DebugDll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Release|Win32.ActiveCfg = Release|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Release|Win32.Build.0 = Release|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Release|x64.ActiveCfg = Release|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Releasedll|Win32.ActiveCfg = Releasedll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Releasedll|Win32.Build.0 = Releasedll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Releasedll|x64.ActiveCfg = Releasedll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Template|Win32.ActiveCfg = DebugDll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Template|Win32.Build.0 = DebugDll|Win32
{95F01BE0-DD1D-4671-8C22-BD420917401B}.Template|x64.ActiveCfg = DebugDll|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -998,6 +1042,8 @@ Global
{ADE6F714-BD52-432D-AB86-62FA59AB6746} = {02535D96-1693-4AA3-B650-B22DC776FDC2}
{9A04F86E-D4CB-45ED-9BB6-9939B9400B6F} = {02535D96-1693-4AA3-B650-B22DC776FDC2}
{BE2DF8B2-2DCD-4F32-99B9-0B0CA24BFAD9} = {02535D96-1693-4AA3-B650-B22DC776FDC2}
{A07145B7-36AE-4D6F-8536-30A8BE48529D} = {02535D96-1693-4AA3-B650-B22DC776FDC2}
{95F01BE0-DD1D-4671-8C22-BD420917401B} = {02535D96-1693-4AA3-B650-B22DC776FDC2}
{41FA5224-3315-4CDA-9C44-19085049F179} = {716AA69D-C8D2-4274-8207-A384FC20EAF0}
{7680672C-4C9B-4BE8-8BAE-BB23B951AAA0} = {716AA69D-C8D2-4274-8207-A384FC20EAF0}
{C0A7DB86-EF13-4A3E-9F34-8950521C9675} = {F1ABE59F-D95A-4CD5-92A2-6A1622E63BAB}

View File

@ -1,5 +1,6 @@
修改历史列表:
------------------------------------------------------------------------
78) 2014.12.14 --- acl 3.0.22 版本发布!
77) 2014.12.1
77.1) 整理工程,将例子按功能进行分类

View File

@ -335,9 +335,6 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
<File
RelativePath=".\src\stream\socket_stream.cpp">
</File>
<File
RelativePath=".\src\stream\ssl_aio_stream.cpp">
</File>
<File
RelativePath=".\src\stream\stream.cpp">
</File>
@ -855,9 +852,6 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
<File
RelativePath=".\include\acl_cpp\stream\socket_stream.hpp">
</File>
<File
RelativePath=".\include\acl_cpp\stream\ssl_aio_stream.hpp">
</File>
<File
RelativePath=".\include\acl_cpp\stream\stream.hpp">
</File>

View File

@ -961,10 +961,6 @@
RelativePath=".\src\stream\socket_stream.cpp"
>
</File>
<File
RelativePath=".\src\stream\ssl_aio_stream.cpp"
>
</File>
<File
RelativePath=".\src\stream\stream.cpp"
>
@ -1503,10 +1499,6 @@
RelativePath=".\include\acl_cpp\stream\socket_stream.hpp"
>
</File>
<File
RelativePath=".\include\acl_cpp\stream\ssl_aio_stream.hpp"
>
</File>
<File
RelativePath=".\include\acl_cpp\stream\stream.hpp"
>

View File

@ -324,7 +324,6 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
<ClCompile Include="src\stream\polarssl_io.cpp" />
<ClCompile Include="src\stream\server_socket.cpp" />
<ClCompile Include="src\stream\socket_stream.cpp" />
<ClCompile Include="src\stream\ssl_aio_stream.cpp" />
<ClCompile Include="src\stream\stream.cpp" />
</ItemGroup>
<ItemGroup>
@ -444,7 +443,6 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
<ClInclude Include="include\acl_cpp\stream\polarssl_io.hpp" />
<ClInclude Include="include\acl_cpp\stream\server_socket.hpp" />
<ClInclude Include="include\acl_cpp\stream\socket_stream.hpp" />
<ClInclude Include="include\acl_cpp\stream\ssl_aio_stream.hpp" />
<ClInclude Include="include\acl_cpp\stream\stream.hpp" />
<ClInclude Include="include\acl_cpp\stream\stream_hook.hpp" />
<ClInclude Include="resource_vc2010.h" />

View File

@ -190,9 +190,6 @@
<ClCompile Include="src\stream\socket_stream.cpp">
<Filter>src\stream</Filter>
</ClCompile>
<ClCompile Include="src\stream\ssl_aio_stream.cpp">
<Filter>src\stream</Filter>
</ClCompile>
<ClCompile Include="src\mime\internal\header_opts.cpp">
<Filter>src\mime\internal</Filter>
</ClCompile>
@ -687,9 +684,6 @@
<ClInclude Include="include\acl_cpp\stream\socket_stream.hpp">
<Filter>include\stream</Filter>
</ClInclude>
<ClInclude Include="include\acl_cpp\stream\ssl_aio_stream.hpp">
<Filter>include\stream</Filter>
</ClInclude>
<ClInclude Include="include\acl_cpp\lib_acl.hpp">
<Filter>include</Filter>
</ClInclude>

View File

@ -328,7 +328,6 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
<ClCompile Include="src\stream\polarssl_io.cpp" />
<ClCompile Include="src\stream\server_socket.cpp" />
<ClCompile Include="src\stream\socket_stream.cpp" />
<ClCompile Include="src\stream\ssl_aio_stream.cpp" />
<ClCompile Include="src\stream\stream.cpp" />
</ItemGroup>
<ItemGroup>
@ -450,7 +449,6 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
<ClInclude Include="include\acl_cpp\stream\polarssl_io.hpp" />
<ClInclude Include="include\acl_cpp\stream\server_socket.hpp" />
<ClInclude Include="include\acl_cpp\stream\socket_stream.hpp" />
<ClInclude Include="include\acl_cpp\stream\ssl_aio_stream.hpp" />
<ClInclude Include="include\acl_cpp\stream\stream.hpp" />
<ClInclude Include="include\acl_cpp\stream\stream_hook.hpp" />
<ClInclude Include="resource_vc2012.h" />

View File

@ -187,9 +187,6 @@
<ClCompile Include="src\stream\socket_stream.cpp">
<Filter>src\stream</Filter>
</ClCompile>
<ClCompile Include="src\stream\ssl_aio_stream.cpp">
<Filter>src\stream</Filter>
</ClCompile>
<ClCompile Include="src\mime\internal\header_opts.cpp">
<Filter>src\mime\internal</Filter>
</ClCompile>
@ -678,9 +675,6 @@
<ClInclude Include="include\acl_cpp\stream\socket_stream.hpp">
<Filter>include\stream</Filter>
</ClInclude>
<ClInclude Include="include\acl_cpp\stream\ssl_aio_stream.hpp">
<Filter>include\stream</Filter>
</ClInclude>
<ClInclude Include="include\acl_cpp\lib_acl.hpp">
<Filter>include</Filter>
</ClInclude>

View File

@ -19,7 +19,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9A04F86E-D4CB-45ED-9BB6-9939B9400B6F}</ProjectGuid>
<ProjectGuid>{95F01BE0-DD1D-4671-8C22-BD420917401B}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>aio_client_ssl</ProjectName>
</PropertyGroup>
@ -109,7 +109,7 @@
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies>lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -123,9 +123,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)aio_client_ssl.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
@ -149,9 +149,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_d.lib;lib_acl_cpp_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_d.lib;lib_acl_cpp_d.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)aio_client_ssl.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)aio_client_ssl.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
@ -172,9 +172,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl.lib;lib_acl_cpp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl.lib;lib_acl_cpp.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)aio_client_ssl.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)aio_client_ssl.pdb</ProgramDatabaseFile>
@ -192,4 +192,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -19,7 +19,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{225D0BFA-64D7-4F8F-951E-36A494CF6178}</ProjectGuid>
<ProjectGuid>{A07145B7-36AE-4D6F-8536-30A8BE48529D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>aio_server_ssl</ProjectName>
</PropertyGroup>
@ -101,7 +101,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)aio_server_ssl.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -123,9 +123,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)aio_server_ssl.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
@ -149,9 +149,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_d.lib;lib_acl_cpp_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_d.lib;lib_acl_cpp_d.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)aio_server_ssl.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)aio_server_ssl.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
@ -172,9 +172,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl.lib;lib_acl_cpp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl.lib;lib_acl_cpp.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)aio_server_ssl.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)aio_server_ssl.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
@ -191,4 +191,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -4,7 +4,7 @@
#include "acl_cpp/stdlib/string.hpp"
#include "acl_cpp/http/http_header.hpp"
#include "acl_cpp/stream/aio_handle.hpp"
#include "acl_cpp/stream/ssl_aio_stream.hpp"
#include "ssl_aio_stream.hpp"
#ifdef WIN32
# ifndef snprintf

View File

@ -222,6 +222,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="polarssl.lib"
OutputFile="$(OutDir)/ssl_aio_client.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\lib\win32"
@ -345,12 +346,20 @@
RelativePath=".\main.cpp"
>
</File>
<File
RelativePath=".\ssl_aio_stream.cpp"
>
</File>
</Filter>
<Filter
Name="头文件"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\ssl_aio_stream.hpp"
>
</File>
</Filter>
<Filter
Name="资源文件"

View File

@ -0,0 +1,343 @@
#include "lib_acl.h"
#ifdef HAS_POLARSSL
# include "polarssl/ssl.h"
# include "polarssl/havege.h"
#endif
#include "acl_cpp/stdlib/log.hpp"
#include "ssl_aio_stream.hpp"
namespace acl
{
ssl_aio_stream::ssl_aio_stream(aio_handle* handle, ACL_ASTREAM* stream,
bool opened /* = false */, bool use_ssl /* = true */)
: aio_stream(handle), aio_socket_stream(handle, stream, opened)
{
#ifdef HAS_POLARSSL
if (use_ssl)
{
ssl_ = acl_mycalloc(1, sizeof(ssl_context));
ssn_ = acl_mycalloc(1, sizeof(ssl_session));
hs_ = acl_mymalloc(sizeof(havege_state));
}
else
{
ssl_ = NULL;
ssn_ = NULL;
hs_ = NULL;
}
#else
(void) use_ssl;
#endif
}
ssl_aio_stream::ssl_aio_stream(aio_handle* handle, ACL_SOCKET fd,
bool use_ssl /* = true */)
: aio_stream(handle), aio_socket_stream(handle, fd)
{
#ifdef HAS_POLARSSL
if (use_ssl)
{
ssl_ = acl_mycalloc(1, sizeof(ssl_context));
ssn_ = acl_mycalloc(1, sizeof(ssl_session));
hs_ = acl_mymalloc(sizeof(havege_state));
}
else
{
ssl_ = NULL;
ssn_ = NULL;
hs_ = NULL;
}
#else
(void) use_ssl;
#endif
}
ssl_aio_stream::~ssl_aio_stream()
{
clear();
}
void ssl_aio_stream::clear()
{
#ifdef HAS_POLARSSL
if (ssl_)
{
ssl_free((ssl_context*) ssl_);
acl_myfree(ssl_);
ssl_ = NULL;
}
if (ssn_)
{
acl_myfree(ssn_);
ssn_ = NULL;
}
if (hs_)
{
acl_myfree(hs_);
hs_ = NULL;
}
#endif
}
bool ssl_aio_stream::open_callback()
{
#ifdef HAS_POLARSSL
if (ssl_)
{
acl_assert(ssn_);
acl_assert(hs_);
return ssl_client_init();
}
return true;
#else
return false;
#endif
}
ssl_aio_stream* ssl_aio_stream::open(aio_handle* handle,
const char* addr, int timeout, bool use_ssl /* = true */)
{
acl_assert(handle);
ACL_ASTREAM* astream =
acl_aio_connect(handle->get_handle(), addr, timeout);
if (astream == NULL)
return NULL;
ssl_aio_stream* stream = new ssl_aio_stream(handle, astream, false);
// 调用基类的 hook_error 以向 handle 中增加异步流计数,
// 同时 hook 关闭及超时回调过程
stream->hook_error();
// hook 连接成功的回调过程
stream->hook_open();
// 如果是使用SSL则注册本类对象为连接成功后的第一个回调过程
if (use_ssl)
stream->add_open_callback(stream);
return stream;
}
bool ssl_aio_stream::open_ssl(bool on)
{
ACL_VSTREAM* stream = get_vstream();
acl_assert(stream);
if (stream == NULL)
{
logger_error("stream null");
return false;
}
if (on)
{
#ifdef HAS_POLARSSL
// 如果打开已经是 SSL 模式的流,则直接返回
if (ssl_ != NULL)
{
acl_assert(ssn_);
acl_assert(hs_);
return true;
}
#endif
// 打开 SSL 流模式
return ssl_client_init();
}
else
{
#ifdef HAS_POLARSSL
// 如果关闭非 SSL 模式的流,则直接返回
if (ssl_ == NULL)
{
ssl_ = NULL;
acl_assert(ssn_ == NULL);
acl_assert(hs_ == NULL);
return true;
}
#endif
// 清除与 SSL 相关的对象
clear();
// 切换成非 SSL 流模式
acl_vstream_ctl(stream,
ACL_VSTREAM_CTL_READ_FN, acl_socket_read,
ACL_VSTREAM_CTL_WRITE_FN, acl_socket_write,
ACL_VSTREAM_CTL_CTX, this,
ACL_VSTREAM_CTL_END);
return true;
}
}
bool ssl_aio_stream::ssl_client_init()
{
#ifdef HAS_POLARSSL
ACL_VSTREAM* stream = get_vstream();
acl_assert(stream);
// 0. Initialize the RNG and the session data
havege_init((havege_state*) hs_);
int ret;
if ((ret = ssl_init((ssl_context*) ssl_)) != 0)
{
logger_error("failed, ssl_init returned %d", ret);
return false;
}
ssl_set_endpoint((ssl_context*) ssl_, SSL_IS_CLIENT);
ssl_set_authmode((ssl_context*) ssl_, SSL_VERIFY_NONE);
ssl_set_rng((ssl_context*) ssl_, ::havege_random, hs_);
//ssl_set_dbg((ssl_context*) ssl_, my_debug, stdout);
ssl_set_bio((ssl_context*) ssl_, __sock_read, this, __sock_send, this);
const int* cipher_suites = ssl_list_ciphersuites();
if (cipher_suites == NULL)
{
logger_error("ssl_list_ciphersuites null");
return false;
}
ssl_set_ciphersuites((ssl_context*) ssl_, cipher_suites);
ssl_set_session((ssl_context*) ssl_, (ssl_session*) ssn_);
acl_vstream_ctl(stream,
ACL_VSTREAM_CTL_READ_FN, __ssl_read,
ACL_VSTREAM_CTL_WRITE_FN, __ssl_send,
ACL_VSTREAM_CTL_CTX, this,
ACL_VSTREAM_CTL_END);
acl_tcp_set_nodelay(ACL_VSTREAM_SOCK(stream));
#endif
return true;
}
int ssl_aio_stream::__sock_read(void *ctx, unsigned char *buf, size_t len)
{
#ifdef HAS_POLARSSL
ssl_aio_stream* cli = (ssl_aio_stream*) ctx;
ACL_VSTREAM* stream = cli->get_vstream();
acl_assert(stream);
int ret, errnum;
if ((ret = acl_socket_read(ACL_VSTREAM_SOCK(stream), buf, len,
0, stream, NULL)) < 0)
{
errnum = acl_last_error();
if (errnum == ACL_EINTR)
return POLARSSL_ERR_NET_WANT_READ;
else if (errnum == ACL_EWOULDBLOCK)
return POLARSSL_ERR_NET_WANT_READ;
#if ACL_EWOULDBLOCK != ACL_EAGAIN
else if (errnum == ACL_EAGAIN)
return POLARSSL_ERR_NET_WANT_READ;
#endif
else if (errnum == ACL_ECONNRESET || errno == EPIPE)
return POLARSSL_ERR_NET_CONN_RESET;
else
return POLARSSL_ERR_NET_RECV_FAILED;
}
return ret;
#else
(void) ctx;
(void) buf;
(void) len;
return -1;
#endif
}
int ssl_aio_stream::__sock_send(void *ctx, const unsigned char *buf, size_t len)
{
#ifdef HAS_POLARSSL
ssl_aio_stream* cli = (ssl_aio_stream*) ctx;
ACL_VSTREAM* stream = cli->get_vstream();
acl_assert(stream);
int ret, errnum;
if ((ret = acl_socket_write(ACL_VSTREAM_SOCK(stream), buf, len,
0, stream, NULL)) < 0)
{
errnum = acl_last_error();
if (errnum == ACL_EINTR)
return POLARSSL_ERR_NET_WANT_WRITE;
else if (errnum == ACL_EWOULDBLOCK)
return POLARSSL_ERR_NET_WANT_WRITE;
#if ACL_EWOULDBLOCK != ACL_EAGAIN
else if (errnum == ACL_EAGAIN)
return POLARSSL_ERR_NET_WANT_WRITE;
#endif
else if (errnum == ACL_ECONNRESET || errno == EPIPE)
return POLARSSL_ERR_NET_CONN_RESET;
else
return POLARSSL_ERR_NET_SEND_FAILED;
}
return ret;
#else
(void) ctx;
(void) buf;
(void) len;
return -1;
#endif
}
int ssl_aio_stream::__ssl_read(ACL_SOCKET, void *buf, size_t len,
int, ACL_VSTREAM*, void *ctx)
{
#ifdef HAS_POLARSSL
ssl_aio_stream* cli = (ssl_aio_stream*) ctx;
int ret;
while ((ret = ::ssl_read((ssl_context*) cli->ssl_,
(unsigned char*) buf, len)) <= 0)
{
if (ret == POLARSSL_ERR_NET_WANT_READ
|| ret == POLARSSL_ERR_NET_WANT_WRITE)
{
if (acl_last_error() != ACL_EWOULDBLOCK)
acl_set_error(ACL_EWOULDBLOCK);
}
return ACL_VSTREAM_EOF;
}
return ret;
#else
(void) buf;
(void) len;
(void) ctx;
return -1;
#endif
}
int ssl_aio_stream::__ssl_send(ACL_SOCKET, const void *buf, size_t len,
int, ACL_VSTREAM*, void *ctx)
{
#ifdef HAS_POLARSSL
ssl_aio_stream* cli = (ssl_aio_stream*) ctx;
int ret;
while ((ret = ::ssl_write((ssl_context*) cli->ssl_,
(unsigned char*) buf, len)) <= 0)
{
if (ret == POLARSSL_ERR_NET_WANT_READ
|| ret == POLARSSL_ERR_NET_WANT_WRITE)
{
if (acl_last_error() != ACL_EWOULDBLOCK)
acl_set_error(ACL_EWOULDBLOCK);
}
return ACL_VSTREAM_EOF;
}
return ret;
#else
(void) buf;
(void) len;
(void) ctx;
return -1;
#endif
}
} // namespace acl

View File

@ -0,0 +1,96 @@
#pragma once
#include "acl_cpp/acl_cpp_define.hpp"
#include "acl_cpp/stream/aio_socket_stream.hpp"
struct ACL_VSTREAM;
namespace acl
{
class ACL_CPP_API ssl_aio_stream
: public aio_socket_stream
, public aio_open_callback
{
public:
/**
*
* @param handle {aio_handle*}
* @param stream {ACL_ASTREAM*}
* @param opened {bool}
* hook / hook /
* @param use_ssl {bool} 使 SSL
*/
ssl_aio_stream(aio_handle* handle, ACL_ASTREAM* stream,
bool opened = false, bool use_ssl = true);
/**
* hook /
* @param handle {aio_handle*}
* @param fd {ACL_SOCKET}
* @param use_ssl {bool} 使 SSL
*/
#ifdef WIN32
ssl_aio_stream(aio_handle* handle, SOCKET fd, bool use_ssl = true);
#else
ssl_aio_stream(aio_handle* handle, int fd, bool use_ssl = true);
#endif
/**
* hook
*
* @param handle {aio_handle*}
* @param addr {const char*}
* TCPIP:Port {filePath}
* @param timeout {int} ()
* @param use_ssl {bool} 使 SSL
* @return {bool} false
* true
*
*/
static ssl_aio_stream* open(aio_handle* handle,
const char* addr, int timeout, bool use_ssl = true);
/**
* SSL
* SSL
* @param on {bool} SSL false
* SSL SSL SSL
* true SSL
* SSL SSL
* @return {bool}
*/
bool open_ssl(bool on);
protected:
virtual ~ssl_aio_stream();
/**
* aio_open_callback
*/
virtual bool open_callback();
private:
void* ssl_;
void* ssn_;
void* hs_;
bool ssl_client_init();
static int __sock_read(void *ctx, unsigned char *buf, size_t len);
static int __sock_send(void *ctx, const unsigned char *buf, size_t len);
#ifdef WIN32
static int __ssl_read(SOCKET fd, void *buf, size_t len,
int timeout, ACL_VSTREAM* stream, void *ctx);
static int __ssl_send(SOCKET fd, const void *buf, size_t len,
int timeout, ACL_VSTREAM* stream, void *ctx);
#else
static int __ssl_read(int fd, void *buf, size_t len,
int timeout, ACL_VSTREAM* stream, void *ctx);
static int __ssl_send(int fd, const void *buf, size_t len,
int timeout, ACL_VSTREAM* stream, void *ctx);
#endif
void clear(void);
};
} // namespace acl

View File

@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="lib_acl_vc2003d.lib lib_protocol_vc2003d.lib polarssl.lib"
AdditionalDependencies="lib_acl_vc2003d.lib lib_protocol_vc2003d.lib"
OutputFile="$(OutDir)/cgi.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib\win32;..\..\..\dist\lib\win32"
@ -220,9 +220,6 @@
Name="Ô´Îļþ"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\main.cpp">
</File>
<File
RelativePath=".\http_servlet.cpp">
</File>

View File

@ -19,7 +19,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
AdditionalIncludeDirectories="..\..\include;..\..\..\lib_acl\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;VC2003"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="lib_acl_vc2003d.lib lib_protocol_vc2003d.lib polarssl.lib"
AdditionalDependencies="lib_acl_vc2003d.lib lib_protocol_vc2003d.lib"
OutputFile="$(OutDir)/cgi_upload.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib\win32;..\..\..\dist\lib\win32"

View File

@ -96,7 +96,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2010d.lib;lib_acl_cpp_vc2010d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2010d.lib;lib_acl_cpp_vc2010d.lib;libmysql.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)mysql_query.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>

View File

@ -109,7 +109,7 @@
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies>lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>lib_acl_vc2012d.lib;lib_acl_cpp_vc2012d.lib;libmysql.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -123,9 +123,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_vc2012.lib;lib_acl_cpp_vc2012.lib;libmysql.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)mysql_query.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>

View File

@ -36,7 +36,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/verbose:lib"
AdditionalDependencies="uxtheme.lib polarssl.lib lib_acl_d.lib lib_protocol_d.lib lib_acl_cpp_d.lib"
AdditionalDependencies="uxtheme.lib lib_acl_d.lib lib_protocol_d.lib lib_acl_cpp_d.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\lib\win32;..\..\..\dist\lib\win32"
IgnoreDefaultLibraryNames="libc"

View File

@ -32,7 +32,6 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="polarssl.lib"
OutputFile="$(OutDir)/http_client2.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib\win32;..\..\..\dist\lib\win32"

View File

@ -32,7 +32,6 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="polarssl.lib"
OutputFile="$(OutDir)/http_server.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib\win32;..\..\..\dist\lib\win32"

View File

@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="lib_acl_vc2003d.lib lib_protocol_vc2003d.lib polarssl.lib"
AdditionalDependencies="lib_acl_vc2003d.lib lib_protocol_vc2003d.lib"
OutputFile="$(OutDir)/http_servlet.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib\win32;..\..\..\dist\lib\win32"

View File

@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="lib_acl_vc2003d.lib lib_protocol_vc2003d.lib polarssl.lib"
AdditionalDependencies="lib_acl_vc2003d.lib lib_protocol_vc2003d.lib"
OutputFile="$(OutDir)/rpc_download.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib\win32;..\..\..\dist\lib\win32"
@ -82,7 +82,6 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="polarssl.lib"
OutputFile="$(OutDir)/rpc_download.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\lib\win32;..\..\..\dist\lib\win32"
@ -136,7 +135,6 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="polarssl.lib"
OutputFile="$(OutDir)/rpc_download.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib\win32"
@ -185,7 +183,6 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="polarssl.lib"
OutputFile="$(OutDir)/rpc_download.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\lib\win32"

View File

@ -149,7 +149,7 @@
</ClCompile>
<Link>
<OutputFile>$(OutDir)ssl_client.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)ssl_client.pdb</ProgramDatabaseFile>
@ -157,6 +157,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_d.lib;lib_acl_cpp_d.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">
@ -170,7 +171,7 @@
</ClCompile>
<Link>
<OutputFile>$(OutDir)ssl_client.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
@ -178,6 +179,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>lib_acl.lib;lib_acl_cpp.lib;lib_protocol.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@ -198,4 +200,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -122,7 +122,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;lib_acl_vc2012.lib;lib_protocol_vc2012.lib;lib_acl_cpp_vc2012.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)ssl_server.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@ -149,7 +149,7 @@
</ClCompile>
<Link>
<OutputFile>$(OutDir)ssl_server.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmt;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)ssl_server.pdb</ProgramDatabaseFile>
@ -157,6 +157,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>ws2_32.lib;wsock32.lib;lib_acl_d.lib;lib_acl_cpp_d.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">
@ -170,7 +171,7 @@
</ClCompile>
<Link>
<OutputFile>$(OutDir)ssl_server.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\lib\win32;..\..\..\..\dist\lib\win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
@ -178,6 +179,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>lib_acl.lib;lib_acl_cpp.lib;lib_protocol.lib;polarssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@ -198,4 +200,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -128,6 +128,7 @@
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<AdditionalLibraryDirectories>..\..\..\..\dist\lib\win32;</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">

View File

@ -329,12 +329,15 @@ const char* query::to_date(time_t t, string& out,
if (fmt == NULL || *fmt == 0)
fmt = "%Y-%m-%d %H:%M:%S";
struct tm* local_ptr;
#ifdef WIN32
# ifdef __STDC_WANT_SECURE_LIB__
struct tm local;
if (localtime_s(&local, &t) != 0)
{
logger_error("localtime_s failed, t: %ld", (long) t);
@ -350,6 +353,7 @@ const char* query::to_date(time_t t, string& out,
}
# endif
#else
struct tm local;
if ((local_ptr = localtime_r(&t, &local)) == NULL)
@ -358,7 +362,7 @@ const char* query::to_date(time_t t, string& out,
return NULL;
}
#endif
if (strftime(buf, sizeof(buf), fmt, &local) == 0)
if (strftime(buf, sizeof(buf), fmt, local_ptr) == 0)
{
logger_error("strftime failed, t: %ld, fmt: %s",
(long) t, fmt);

View File

@ -1,6 +1,6 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: test.proto
#include "stdafx.h"
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "test.pb.h"