mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 19:25:51 +00:00
Compare commits
190 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29a4f61551 | ||
|
|
c2fd1215f5 | ||
|
|
e3c1375f36 | ||
|
|
4e357601ec | ||
|
|
3674b01634 | ||
|
|
f66aee4e7f | ||
|
|
b2f06dbe3c | ||
|
|
b78076670e | ||
|
|
a08a0703b6 | ||
|
|
f80561e6aa | ||
|
|
f5765b71f2 | ||
|
|
6a6be847c0 | ||
|
|
4e26108a06 | ||
|
|
c517d261bb | ||
|
|
5522a23670 | ||
|
|
64345f90a8 | ||
|
|
879c0d6b78 | ||
|
|
2e8df429df | ||
|
|
7aa1222310 | ||
|
|
2b5142ee4d | ||
|
|
e8d7d339ef | ||
|
|
5324a6d59d | ||
|
|
569b3a46a1 | ||
|
|
fc129e43fd | ||
|
|
b22a0f4a97 | ||
|
|
cf63b5c859 | ||
|
|
b4593a274d | ||
|
|
163daf012a | ||
|
|
63df034bcf | ||
|
|
60787be80c | ||
|
|
f42ae3af21 | ||
|
|
b1fea3c51e | ||
|
|
16d2bbd6e5 | ||
|
|
2505a908c5 | ||
|
|
4b71673ee9 | ||
|
|
242494a9ad | ||
|
|
3a684ce280 | ||
|
|
756da7b844 | ||
|
|
9c465487ae | ||
|
|
e8002a7a62 | ||
|
|
5a53b48026 | ||
|
|
b3f725d9fd | ||
|
|
50f5d5bdf3 | ||
|
|
6c0edd2190 | ||
|
|
d9a0181189 | ||
|
|
09570996a9 | ||
|
|
adc4c855ca | ||
|
|
8b1df06a94 | ||
|
|
7c81eec30c | ||
|
|
faa999d6d0 | ||
|
|
370bfb7a22 | ||
|
|
ae649ec917 | ||
|
|
93b44fcdc1 | ||
|
|
1fe57720c4 | ||
|
|
fca8fa1b1b | ||
|
|
81082ad10f | ||
|
|
2c515636cb | ||
|
|
2f7ac98e34 | ||
|
|
37b39ed1a1 | ||
|
|
73485d5a23 | ||
|
|
28c7827f14 | ||
|
|
e055dc1513 | ||
|
|
c173f14fc0 | ||
|
|
cd30e552a7 | ||
|
|
9bf1a76e91 | ||
|
|
2957b688fd | ||
|
|
add40d524f | ||
|
|
04a55e35b6 | ||
|
|
955ce45448 | ||
|
|
995e64a205 | ||
|
|
bf085f0ef3 | ||
|
|
1374b37882 | ||
|
|
e275f4eb9d | ||
|
|
652d809129 | ||
|
|
c186519bcf | ||
|
|
870fb4f291 | ||
|
|
7cd63489f4 | ||
|
|
616a53888e | ||
|
|
a336cc26f9 | ||
|
|
382088c456 | ||
|
|
ff80531db4 | ||
|
|
105cf3cd1e | ||
|
|
38ba7e695a | ||
|
|
996326a00e | ||
|
|
f2beb82b97 | ||
|
|
41c0702408 | ||
|
|
66b5f75142 | ||
|
|
c2a16ddbab | ||
|
|
5bb194cf89 | ||
|
|
645b9a01c7 | ||
|
|
3a1a5d12de | ||
|
|
12748e7539 | ||
|
|
2f69d4c8ee | ||
|
|
8dbf8b9038 | ||
|
|
fdfe047f3e | ||
|
|
38c3f84c9f | ||
|
|
9c5b071556 | ||
|
|
46dc52e449 | ||
|
|
f469e3853d | ||
|
|
a681a4fcd4 | ||
|
|
575b0bb7b0 | ||
|
|
588cf4bfca | ||
|
|
9cc8c341e7 | ||
|
|
9b657ba224 | ||
|
|
9bc6e83f8a | ||
|
|
572aae320d | ||
|
|
2906899811 | ||
|
|
1a6bf88900 | ||
|
|
e60b28980a | ||
|
|
a253b2ef4b | ||
|
|
0c2e35edc9 | ||
|
|
d0970397a6 | ||
|
|
0afbda0351 | ||
|
|
2009f8b1ca | ||
|
|
35715a0146 | ||
|
|
20e27ceb04 | ||
|
|
7fb614f7af | ||
|
|
83442825e5 | ||
|
|
123c482a69 | ||
|
|
3f091fce59 | ||
|
|
6c5f88aa25 | ||
|
|
23eccebf5b | ||
|
|
15112c1a27 | ||
|
|
d0ca81ff36 | ||
|
|
3e218c494d | ||
|
|
88bd5b12a4 | ||
|
|
5df5983f88 | ||
|
|
aa5ca7cea5 | ||
|
|
02483b2e0b | ||
|
|
f7817866ba | ||
|
|
d62287d54b | ||
|
|
aad074cd8e | ||
|
|
580d179dd0 | ||
|
|
616a514c4d | ||
|
|
bac8d41954 | ||
|
|
f295bb20a1 | ||
|
|
b5ffa2351a | ||
|
|
1b37b52071 | ||
|
|
b1ffd10079 | ||
|
|
39235f5b91 | ||
|
|
8825d94636 | ||
|
|
c8a7b2af56 | ||
|
|
d22b25c030 | ||
|
|
d475994e02 | ||
|
|
f0bb3dfdfb | ||
|
|
e7f0b8eca6 | ||
|
|
0bab6a9fec | ||
|
|
9486fc416c | ||
|
|
fb63aa737a | ||
|
|
58a6ca1d3d | ||
|
|
505f029edb | ||
|
|
815659b898 | ||
|
|
07d16f280c | ||
|
|
f88ddc947c | ||
|
|
65ffdff40c | ||
|
|
c95dccfec6 | ||
|
|
fe83f471f5 | ||
|
|
d2953f602e | ||
|
|
9d07ddeae1 | ||
|
|
ef7810bc95 | ||
|
|
486539b3d3 | ||
|
|
990fb20a2a | ||
|
|
9b61a83721 | ||
|
|
f753519976 | ||
|
|
663e38dcdd | ||
|
|
7570b6489d | ||
|
|
c341d1a71e | ||
|
|
fa10e90c9d | ||
|
|
68501763dd | ||
|
|
cac1d555be | ||
|
|
25ff77c2fd | ||
|
|
2870c7f457 | ||
|
|
ab8d7a86ae | ||
|
|
809359e81e | ||
|
|
6e4cd5bc9c | ||
|
|
de018bd582 | ||
|
|
544642a6ea | ||
|
|
06737bb36f | ||
|
|
7efbfa2d20 | ||
|
|
4d5df92cbc | ||
|
|
1fcb2872b9 | ||
|
|
00c87ca2dd | ||
|
|
d474d68566 | ||
|
|
93e03804d0 | ||
|
|
4591658160 | ||
|
|
a2109b4bda | ||
|
|
deafea9c88 | ||
|
|
93f1a05f5c | ||
|
|
95a573b755 | ||
|
|
2a4623814c |
44
.travis.yml
44
.travis.yml
@@ -1,10 +1,50 @@
|
||||
language: cpp
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq libboost1.48-all-dev protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
|
||||
script: scons && npm install && npm test
|
||||
- sudo apt-get install -qq python-software-properties
|
||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
- sudo add-apt-repository -y ppa:boost-latest/ppa
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq g++-4.8
|
||||
- sudo apt-get install -qq libboost1.55-all-dev
|
||||
# We want debug symbols for boost as we install gdb later
|
||||
- sudo apt-get install -qq libboost1.55-dbg
|
||||
- sudo apt-get install -qq mlocate
|
||||
- sudo updatedb
|
||||
- sudo locate libboost | grep /lib | grep -e ".a$"
|
||||
- sudo apt-get install -qq protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
|
||||
# We need gcc >= 4.8 for some c++11 features
|
||||
- sudo apt-get install -qq gcc-4.8
|
||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
|
||||
- sudo update-alternatives --set gcc /usr/bin/gcc-4.8
|
||||
# Stuff is gold. Nuff said ;)
|
||||
- sudo apt-get -y install binutils-gold
|
||||
# We can get a backtrace if the guy crashes
|
||||
- sudo apt-get -y install gdb
|
||||
# What versions are we ACTUALLY running?
|
||||
- g++ -v
|
||||
- clang -v
|
||||
|
||||
script:
|
||||
# Set so any failing command will abort the build
|
||||
- set -e
|
||||
# If only we could do -j12 ;)
|
||||
- scons
|
||||
# See what we've actually built
|
||||
- ldd ./build/rippled
|
||||
# Run unittests (under gdb)
|
||||
- | # create gdb script
|
||||
echo "set env MALLOC_CHECK_=3" > script.gdb
|
||||
echo "run" >> script.gdb
|
||||
echo "backtrace full" >> script.gdb
|
||||
# gdb --help
|
||||
- cat script.gdb | gdb --ex 'set print thread-events off' --return-child-result --args ./build/rippled --unittest
|
||||
# Run integration tests
|
||||
- npm install
|
||||
- npm test
|
||||
notifications:
|
||||
email:
|
||||
false
|
||||
|
||||
@@ -45,7 +45,7 @@ linux-g++:QMAKE_CXXFLAGS += \
|
||||
-pthread
|
||||
|
||||
INCLUDEPATH += \
|
||||
"../../src" \
|
||||
"../../src/BeastConfig/" \
|
||||
"../../src/leveldb/" \
|
||||
"../../src/leveldb/port" \
|
||||
"../../src/leveldb/include" \
|
||||
@@ -69,8 +69,8 @@ SOURCES += \
|
||||
../../src/ripple/http/ripple_http.cpp \
|
||||
../../src/ripple/json/ripple_json.cpp \
|
||||
../../src/ripple/peerfinder/ripple_peerfinder.cpp \
|
||||
../../src/ripple/radmap/ripple_radmap.cpp \
|
||||
../../src/ripple/resource/ripple_resource.cpp \
|
||||
../../src/ripple/rpc/ripple_rpc.cpp \
|
||||
../../src/ripple/sitefiles/ripple_sitefiles.cpp \
|
||||
../../src/ripple/sslutil/ripple_sslutil.cpp \
|
||||
../../src/ripple/testoverlay/ripple_testoverlay.cpp \
|
||||
@@ -96,6 +96,8 @@ SOURCES += \
|
||||
../../src/ripple_hyperleveldb/ripple_hyperleveldb.cpp \
|
||||
../../src/ripple_leveldb/ripple_leveldb.cpp \
|
||||
../../src/ripple_net/ripple_net.cpp \
|
||||
../../src/ripple_overlay/ripple_overlay.cpp \
|
||||
../../src/ripple_rpc/ripple_rpc.cpp \
|
||||
../../src/ripple_websocket/ripple_websocket.cpp
|
||||
|
||||
LIBS += \
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<RepoDir>..\..</RepoDir>
|
||||
<SrcDir>$(RepoDir)\src\cpp\ripple</SrcDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutDir>$(RepoDir)\build\VisualStudio2010\$(Configuration).$(Platform)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<IntDir>$(RepoDir)\build\obj\VisualStudio2010\$(Configuration).$(Platform)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(RepoDir);$(RepoDir)\src\cpp\leveldb;$(RepoDir)\src\cpp\leveldb\include;$(RepoDir)\src\cpp\protobuf\src;$(RepoDir)\src\cpp\protobuf\vsprojects;$(RepoDir)\build\proto;$(RepoDir)\Subtrees\beast;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>USE_LEVELDB;BOOST_TEST_ALTERNATIVE_INIT_API;BOOST_TEST_NO_MAIN;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<BuildMacro Include="RepoDir">
|
||||
<Value>$(RepoDir)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="SrcDir">
|
||||
<Value>$(SrcDir)</Value>
|
||||
</BuildMacro>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj", "{EE95954F-3D34-4FB1-ADBD-FE8395233026}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE95954F-3D34-4FB1-ADBD-FE8395233026}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EE95954F-3D34-4FB1-ADBD-FE8395233026}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EE95954F-3D34-4FB1-ADBD-FE8395233026}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EE95954F-3D34-4FB1-ADBD-FE8395233026}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,98 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{EE95954F-3D34-4FB1-ADBD-FE8395233026}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>RippleD</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="RippleD.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt1.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt2.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt3.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt4.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_basics\ripple_basics.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_data\ripple_data.cpp" />
|
||||
<ClCompile Include="..\..\src\cpp\database\sqlite3.c" />
|
||||
<ClCompile Include="..\..\src\cpp\leveldb_core.cpp" />
|
||||
<ClCompile Include="..\..\src\cpp\protobuf_core.cpp" />
|
||||
<ClCompile Include="..\..\src\cpp\websocket_core.cpp" />
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_basics\beast_basics.cpp" />
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_core\beast_core.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt1.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt2.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt3.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_app\ripple_app_pt4.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_basics\ripple_basics.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_data\ripple_data.cpp" />
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_basics\beast_basics.cpp">
|
||||
<Filter>Subtrees</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_core\beast_core.cpp">
|
||||
<Filter>Subtrees</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\cpp\leveldb_core.cpp">
|
||||
<Filter>Subtrees</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\cpp\protobuf_core.cpp">
|
||||
<Filter>Subtrees</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\cpp\websocket_core.cpp">
|
||||
<Filter>Subtrees</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\cpp\database\sqlite3.c">
|
||||
<Filter>Subtrees</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Ripple">
|
||||
<UniqueIdentifier>{63db902e-0e7a-42d1-b5f5-663e4b48786c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Subtrees">
|
||||
<UniqueIdentifier>{469e8a0a-64bf-4fa1-8b6f-81207db68577}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -5,8 +5,8 @@
|
||||
<RepoDir>..\..</RepoDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutDir>$(RepoDir)\build\VisualStudio2012\$(Configuration).$(Platform)\</OutDir>
|
||||
<IntDir>$(RepoDir)\build\obj\VisualStudio2012\$(Configuration).$(Platform)\</IntDir>
|
||||
<OutDir>$(RepoDir)\build\VisualStudio2013\$(Configuration).$(Platform)\</OutDir>
|
||||
<IntDir>$(RepoDir)\build\obj\VisualStudio2013\$(Configuration).$(Platform)\</IntDir>
|
||||
<TargetName>rippled</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
@@ -14,7 +14,7 @@
|
||||
<PreprocessorDefinitions>_VARIADIC_MAX=10;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>$(RepoDir)\src\protobuf\src;$(RepoDir)\src\protobuf\vsprojects;$(RepoDir)\src;$(RepoDir)\src\leveldb;$(RepoDir)\src\leveldb\include;$(RepoDir)\build\proto;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(RepoDir)\src\BeastConfig;$(RepoDir)\src\protobuf\src;$(RepoDir)\src\protobuf\vsprojects;$(RepoDir)\src\leveldb;$(RepoDir)\src\leveldb\include;$(RepoDir)\build\proto;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -22,7 +22,37 @@
|
||||
<ClCompile Include="..\..\build\proto\ripple.pb.cc" />
|
||||
<ClCompile Include="..\..\src\ripple\beast\ripple_beast.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple\beast\ripple_beastc.c" />
|
||||
<ClCompile Include="..\..\src\ripple\common\functional\impl\counted_bind.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\counted_bind.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\KeyCache.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\MultiSocket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\ResolverAsio.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\RippleSSLContext.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\TaggedCache.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
@@ -54,6 +84,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\http\ripple_http.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple\json\impl\JsonPropertyStream.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\json\impl\json_reader.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -79,6 +115,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\json\ripple_json.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\Bootcache.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\Checker.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -91,13 +133,19 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\ConnectHandouts.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\Endpoint.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\Cache.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\Livecache.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
@@ -109,13 +157,25 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\Resolver.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\RedirectHandouts.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\Slots.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\SlotHandouts.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\SlotImp.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\SlotImp.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
@@ -127,13 +187,20 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\impl\Tests.cpp">
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\ripple_peerfinder.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\sim\Tests.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\peerfinder\ripple_peerfinder.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple\radmap\impl\BasicFullBelowCache.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\radmap\ripple_radmap.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple\resource\impl\Charge.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -604,25 +671,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\impl\Handler.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\impl\Manager.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\impl\Service.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\rpc\ripple_rpc.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple\sitefiles\impl\Manager.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -680,12 +728,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\types\impl\JsonPropertyStream.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\types\impl\RandomNumbers.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -838,6 +880,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\ledger\DirectoryEntryIterator.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\ledger\Ledger.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -910,6 +958,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\ledger\OrderBookIterator.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\ledger\SerializedValidation.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1090,6 +1144,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\paths\PathRequests.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\paths\PathState.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1114,33 +1174,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\peers\NameResolver.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\peers\PackedMessage.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\peers\PeerDoor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\peers\Peer.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\peers\Peers.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\peers\PeerSet.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1202,6 +1235,7 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\ripple_app_pt9.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_app\rpc\RPCServerHandler.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1274,43 +1308,55 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\AccountSetTransactor.cpp">
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\AccountSetTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\ChangeTransactor.cpp">
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\ChangeTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\OfferCancelTransactor.cpp">
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\OfferCancelTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\OfferCreateTransactor.cpp">
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\OfferCreateTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\PaymentTransactor.cpp">
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\PaymentTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\RegularKeySetTransactor.cpp">
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\RegularKeySetTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\TransactionAcquire.cpp">
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\Transactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\TrustSetTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\WalletAddTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
@@ -1322,6 +1368,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\TransactionAcquire.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\TransactionCheck.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1352,30 +1404,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\Transactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\TrustSetTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\TxQueueEntry.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\tx\WalletAddTransactor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_app\websocket\WSConnection.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1400,12 +1434,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_basics\containers\TaggedCache.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_basics\log\Log.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1539,12 +1567,24 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\Backend.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\BatchWriter.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\Database.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\DecodedBlob.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1563,12 +1603,36 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\Factory.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\Manager.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\NodeObject.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\Scheduler.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\impl\Task.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_core\nodestore\NodeStore.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1690,6 +1754,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_data\protocol\STParsedJSON.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_data\protocol\TER.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1705,12 +1775,6 @@
|
||||
<ClCompile Include="..\..\src\ripple_data\ripple_data.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_hyperleveldb\ripple_hyperleveldb.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_leveldb\ripple_leveldb.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\RippleSSLContext.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\HTTPRequest.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1723,12 +1787,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\MultiSocket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\RPCDoor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1774,6 +1832,44 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_overlay\impl\PackedMessage.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_overlay\impl\PeerDoor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_overlay\impl\Peers.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_overlay\ripple_overlay.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_rpc\impl\DoPrint.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_rpc\impl\ErrorCodes.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_rpc\impl\Manager.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_rpc\ripple_rpc.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_websocket\autosocket\AutoSocket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -2132,10 +2228,19 @@
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\BeastConfig\BeastConfig.h" />
|
||||
<ClInclude Include="..\..\src\ripple\algorithm\api\CycledSet.h" />
|
||||
<ClInclude Include="..\..\src\ripple\algorithm\api\DecayingSample.h" />
|
||||
<ClInclude Include="..\..\src\ripple\algorithm\api\DiscreteClock.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\functional\counted_bind.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\byte_view.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\counted_bind.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\impl\MultiSocketType.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\KeyCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\MultiSocket.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\Resolver.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\ResolverAsio.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\RippleSSLContext.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\seconds_clock.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\TaggedCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\http\api\Handler.h" />
|
||||
<ClInclude Include="..\..\src\ripple\http\api\Server.h" />
|
||||
<ClInclude Include="..\..\src\ripple\http\api\Port.h" />
|
||||
@@ -2146,6 +2251,7 @@
|
||||
<ClInclude Include="..\..\src\ripple\http\impl\ServerImpl.h" />
|
||||
<ClInclude Include="..\..\src\ripple\http\impl\Types.h" />
|
||||
<ClInclude Include="..\..\src\ripple\http\ripple_http.h" />
|
||||
<ClInclude Include="..\..\src\ripple\json\api\JsonPropertyStream.h" />
|
||||
<ClInclude Include="..\..\src\ripple\json\api\json_config.h" />
|
||||
<ClInclude Include="..\..\src\ripple\json\api\json_features.h" />
|
||||
<ClInclude Include="..\..\src\ripple\json\api\json_forwards.h" />
|
||||
@@ -2159,26 +2265,39 @@
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\api\Config.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\api\Endpoint.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\api\Manager.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\api\Slot.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\api\Types.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\CachedEndpoint.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Bootcache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Checker.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\CheckerAdapter.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Cache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Giveaways.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\GiveawaysAtHop.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\LegacyEndpoint.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\LegacyEndpointCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\ConnectHandouts.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Fixed.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\handout.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\iosformat.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Livecache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Logic.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\LogicType.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\PeerInfo.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Resolver.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Slots.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\PrivateTypes.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\RedirectHandouts.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Reporting.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Counts.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\SlotHandouts.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Source.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\SourceStrings.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Store.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\StoreSqdb.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\impl\Tuning.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\ripple_peerfinder.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\FunctionQueue.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\GraphAlgorithms.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\Message.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\NodeSnapshot.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\Params.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\Predicates.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\sync_timer.h" />
|
||||
<ClInclude Include="..\..\src\ripple\peerfinder\sim\WrappedSink.h" />
|
||||
<ClInclude Include="..\..\src\ripple\radmap\api\BasicFullBelowCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\radmap\api\Tuning.h" />
|
||||
<ClInclude Include="..\..\src\ripple\radmap\ripple_radmap.h" />
|
||||
<ClInclude Include="..\..\src\ripple\resource\api\Charge.h" />
|
||||
<ClInclude Include="..\..\src\ripple\resource\api\Consumer.h" />
|
||||
<ClInclude Include="..\..\src\ripple\resource\api\Disposition.h" />
|
||||
@@ -2284,11 +2403,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\rocksdb\rocksdb\util\string_util.h" />
|
||||
<ClInclude Include="..\..\src\ripple\rocksdb\rocksdb\util\testharness.h" />
|
||||
<ClInclude Include="..\..\src\ripple\rocksdb\rocksdb\util\testutil.h" />
|
||||
<ClInclude Include="..\..\src\ripple\rpc\api\Handler.h" />
|
||||
<ClInclude Include="..\..\src\ripple\rpc\api\Manager.h" />
|
||||
<ClInclude Include="..\..\src\ripple\rpc\api\Service.h" />
|
||||
<ClInclude Include="..\..\src\ripple\rpc\impl\ManagerImpl.h" />
|
||||
<ClInclude Include="..\..\src\ripple\rpc\ripple_rpc.h" />
|
||||
<ClInclude Include="..\..\src\ripple\sitefiles\api\Listener.h" />
|
||||
<ClInclude Include="..\..\src\ripple\sitefiles\api\Manager.h" />
|
||||
<ClInclude Include="..\..\src\ripple\sitefiles\api\Section.h" />
|
||||
@@ -2321,7 +2435,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\types\api\IdentifierStorage.h" />
|
||||
<ClInclude Include="..\..\src\ripple\types\api\IdentifierType.h" />
|
||||
<ClInclude Include="..\..\src\ripple\types\api\HashMaps.h" />
|
||||
<ClInclude Include="..\..\src\ripple\types\api\JsonPropertyStream.h" />
|
||||
<ClInclude Include="..\..\src\ripple\types\api\RandomNumbers.h" />
|
||||
<ClInclude Include="..\..\src\ripple\types\api\RippleAccountID.h" />
|
||||
<ClInclude Include="..\..\src\ripple\types\api\RippleAccountPrivateKey.h" />
|
||||
@@ -2365,6 +2478,7 @@
|
||||
<ClInclude Include="..\..\src\ripple_app\data\DatabaseCon.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\data\DBInit.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\data\SqliteDatabase.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\DirectoryEntryIterator.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\Ledger.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\LedgerCleaner.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\LedgerMaster.h" />
|
||||
@@ -2378,8 +2492,10 @@
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\InboundLedgers.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\LedgerEntrySet.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\LedgerHistory.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\OrderBookIterator.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ledger\SerializedValidation.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\main\CollectorManager.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\main\FullBelowCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\main\IoServicePool.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\main\NodeStoreScheduler.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\main\ParameterTable.h" />
|
||||
@@ -2389,6 +2505,7 @@
|
||||
<ClInclude Include="..\..\src\ripple_app\main\LocalCredentials.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\main\RippleMain.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\main\RPCHTTPServer.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\main\Tuning.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\misc\NetworkOPs.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\misc\PowResult.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\misc\AccountItem.h" />
|
||||
@@ -2409,16 +2526,12 @@
|
||||
<ClInclude Include="..\..\src\ripple_app\node\SqliteFactory.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\paths\Pathfinder.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\paths\PathRequest.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\paths\PathRequests.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\paths\PathState.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\paths\RippleCalc.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\paths\RippleLineCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\paths\RippleState.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\peers\NameResolver.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\peers\PackedMessage.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\peers\PeerDoor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\peers\ClusterNodeStatus.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\peers\Peers.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\peers\Peer.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\peers\PeerSet.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\peers\UniqueNodeList.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\ripple_app.h" />
|
||||
@@ -2433,28 +2546,27 @@
|
||||
<ClInclude Include="..\..\src\ripple_app\shamap\SHAMapSyncFilters.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\shamap\RadixMapTest.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\shamap\SHAMapTreeNode.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\AccountSetTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\ChangeTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\OfferCancelTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\OfferCreateTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\PaymentTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\RegularKeySetTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\TransactionAcquire.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\AccountSetTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\ChangeTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\OfferCancelTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\OfferCreateTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\PaymentTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\RegularKeySetTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\Transactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\TrustSetTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\WalletAddTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\Transaction.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\TransactionAcquire.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\TransactionEngine.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\TransactionMaster.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\TransactionMeta.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\TxQueue.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\Transactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\TrustSetTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\TxQueueEntry.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\tx\WalletAddTransactor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\websocket\WSConnection.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\websocket\WSDoor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_app\websocket\WSServerHandler.h" />
|
||||
<ClInclude Include="..\..\src\ripple_basics\containers\KeyCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple_basics\containers\RangeSet.h" />
|
||||
<ClInclude Include="..\..\src\ripple_basics\containers\TaggedCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple_basics\containers\SyncUnorderedMap.h" />
|
||||
<ClInclude Include="..\..\src\ripple_basics\log\Log.h" />
|
||||
<ClInclude Include="..\..\src\ripple_basics\log\LogFile.h" />
|
||||
<ClInclude Include="..\..\src\ripple_basics\log\LoggedTimings.h" />
|
||||
@@ -2484,6 +2596,7 @@
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\api\Database.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\api\DummyScheduler.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\api\Factory.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\api\Manager.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\api\NodeObject.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\api\Scheduler.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\api\Task.h" />
|
||||
@@ -2498,7 +2611,7 @@
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\impl\DatabaseImp.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\impl\DecodedBlob.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\impl\EncodedBlob.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\impl\Factories.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\impl\Tuning.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\NodeStore.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\nodestore\tests\TestBase.h" />
|
||||
<ClInclude Include="..\..\src\ripple_core\ripple_core.h" />
|
||||
@@ -2518,6 +2631,7 @@
|
||||
<ClInclude Include="..\..\src\ripple_data\protocol\SerializedObjectTemplate.h" />
|
||||
<ClInclude Include="..\..\src\ripple_data\protocol\SerializedTypes.h" />
|
||||
<ClInclude Include="..\..\src\ripple_data\protocol\Serializer.h" />
|
||||
<ClInclude Include="..\..\src\ripple_data\protocol\STParsedJSON.h" />
|
||||
<ClInclude Include="..\..\src\ripple_data\protocol\TER.h" />
|
||||
<ClInclude Include="..\..\src\ripple_data\protocol\TxFlags.h" />
|
||||
<ClInclude Include="..\..\src\ripple_data\protocol\TxFormats.h" />
|
||||
@@ -2525,12 +2639,9 @@
|
||||
<ClInclude Include="..\..\src\ripple_data\utility\UptimeTimerAdapter.h" />
|
||||
<ClInclude Include="..\..\src\ripple_hyperleveldb\ripple_hyperleveldb.h" />
|
||||
<ClInclude Include="..\..\src\ripple_leveldb\ripple_leveldb.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\impl\MultiSocketType.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\impl\RPCServerImp.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RippleSSLContext.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\HTTPRequest.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\HTTPClient.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\MultiSocket.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RPCDoor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RPCServer.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\SNTPClient.h" />
|
||||
@@ -2540,9 +2651,19 @@
|
||||
<ClInclude Include="..\..\src\ripple_net\rpc\RPCErr.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\rpc\RPCSub.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\rpc\RPCUtil.h" />
|
||||
<ClInclude Include="..\..\src\ripple_overlay\api\PackedMessage.h" />
|
||||
<ClInclude Include="..\..\src\ripple_overlay\api\Peer.h" />
|
||||
<ClInclude Include="..\..\src\ripple_overlay\api\Peers.h" />
|
||||
<ClInclude Include="..\..\src\ripple_overlay\impl\PeerDoor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_overlay\impl\PeerImp.h" />
|
||||
<ClInclude Include="..\..\src\ripple_overlay\ripple_overlay.h" />
|
||||
<ClInclude Include="..\..\src\ripple_rpc\api\ErrorCodes.h" />
|
||||
<ClInclude Include="..\..\src\ripple_rpc\api\Manager.h" />
|
||||
<ClInclude Include="..\..\src\ripple_rpc\api\Request.h" />
|
||||
<ClInclude Include="..\..\src\ripple_rpc\impl\Command.h" />
|
||||
<ClInclude Include="..\..\src\ripple_rpc\ripple_rpc.h" />
|
||||
<ClInclude Include="..\..\src\ripple_websocket\autosocket\AutoSocket.h" />
|
||||
<ClInclude Include="..\..\src\ripple_websocket\ripple_websocket.h" />
|
||||
<ClInclude Include="..\..\src\BeastConfig.h" />
|
||||
<ClInclude Include="..\..\src\leveldb\db\builder.h" />
|
||||
<ClInclude Include="..\..\src\leveldb\db\dbformat.h" />
|
||||
<ClInclude Include="..\..\src\leveldb\db\db_impl.h" />
|
||||
@@ -2652,10 +2773,10 @@
|
||||
<None Include="..\..\src\ripple\json\TODO.md" />
|
||||
<None Include="..\..\src\ripple\peerfinder\README.md" />
|
||||
<None Include="..\..\src\ripple\peerfinder\TODO.md" />
|
||||
<None Include="..\..\src\ripple\radmap\README.md" />
|
||||
<None Include="..\..\src\ripple\radmap\TODO.md" />
|
||||
<None Include="..\..\src\ripple\resource\README.md" />
|
||||
<None Include="..\..\src\ripple\resource\TODO.md" />
|
||||
<None Include="..\..\src\ripple\rpc\README.md" />
|
||||
<None Include="..\..\src\ripple\rpc\TODO.md" />
|
||||
<None Include="..\..\src\ripple\sitefiles\README.md" />
|
||||
<None Include="..\..\src\ripple\sitefiles\TODO.md" />
|
||||
<None Include="..\..\src\ripple\sslutil\README.md" />
|
||||
@@ -2668,6 +2789,10 @@
|
||||
<None Include="..\..\src\ripple\validators\README.md" />
|
||||
<None Include="..\..\src\ripple_app\ledger\TODO.md" />
|
||||
<None Include="..\..\src\ripple_app\TODO.md" />
|
||||
<None Include="..\..\src\ripple_overlay\README.md" />
|
||||
<None Include="..\..\src\ripple_overlay\TODO.md" />
|
||||
<None Include="..\..\src\ripple_rpc\README.md" />
|
||||
<None Include="..\..\src\ripple_rpc\TODO.md" />
|
||||
<None Include="..\QtCreator\rippled.pro" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -2678,31 +2803,32 @@
|
||||
<ProjectGuid>{B7F39ECD-473C-484D-BC34-31F8362506A5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>RippleD</RootNamespace>
|
||||
<IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,11 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj", "{B7F39ECD-473C-484D-BC34-31F8362506A5}"
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30110.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "beast", "..\..\src\beast\Builds\VisualStudio2013\beast.vcxproj", "{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "beast", "..\..\src\beast\Builds\VisualStudio2012\beast.vcxproj", "{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj", "{B7F39ECD-473C-484D-BC34-31F8362506A5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -13,14 +15,6 @@ Global
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|x64.Build.0 = Debug|x64
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|Win32.Build.0 = Release|Win32
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|x64.ActiveCfg = Release|x64
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|x64.Build.0 = Release|x64
|
||||
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@@ -29,6 +23,14 @@ Global
|
||||
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|Win32.Build.0 = Release|Win32
|
||||
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|x64.ActiveCfg = Release|x64
|
||||
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|x64.Build.0 = Release|x64
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Debug|x64.Build.0 = Debug|x64
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|Win32.Build.0 = Release|Win32
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|x64.ActiveCfg = Release|x64
|
||||
{B7F39ECD-473C-484D-BC34-31F8362506A5}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -1,6 +1,6 @@
|
||||
#Ripple - P2P Payment Network
|
||||
|
||||
##[](https://ci.ripple.com/jenkins/job/rippled/)
|
||||
##[](https://travis-ci.org/ripple/rippled)
|
||||
|
||||
This is the repository for Ripple's `rippled`, reference P2P network server.
|
||||
|
||||
|
||||
87
SConstruct
87
SConstruct
@@ -8,6 +8,7 @@ import glob
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
|
||||
OSX = bool(platform.mac_ver()[0])
|
||||
FreeBSD = bool('FreeBSD' == platform.system())
|
||||
@@ -16,10 +17,12 @@ Ubuntu = bool(Linux and 'Ubuntu' == platform.linux_distribution()[0])
|
||||
Debian = bool(Linux and 'debian' == platform.linux_distribution()[0])
|
||||
Archlinux = bool(Linux and ('','','') == platform.linux_distribution()) #Arch still has issues with the platform module
|
||||
|
||||
USING_CLANG = OSX or os.environ.get('CC', None) == 'clang'
|
||||
|
||||
#
|
||||
# We expect this to be set
|
||||
#
|
||||
BOOST_HOME = os.environ.get("RIPPLED_BOOST_HOME", None)
|
||||
#
|
||||
BOOST_HOME = os.environ.get("RIPPLED_BOOST_HOME", None)
|
||||
|
||||
|
||||
if OSX or Ubuntu or Debian or Archlinux:
|
||||
@@ -33,8 +36,12 @@ else:
|
||||
# scons tools
|
||||
#
|
||||
|
||||
HONOR_ENVS = ['CC', 'CXX', 'PATH']
|
||||
|
||||
env = Environment(
|
||||
tools = ['default', 'protoc']
|
||||
tools = ['default', 'protoc'],
|
||||
#ENV = dict((k, os.environ[k]) for k in HONOR_ENVS)
|
||||
ENV = dict((k, os.environ[k]) for k in HONOR_ENVS if k in os.environ)
|
||||
)
|
||||
|
||||
# Use a newer gcc on FreeBSD
|
||||
@@ -44,12 +51,19 @@ if FreeBSD:
|
||||
env.Append(CCFLAGS = ['-Wl,-rpath=/usr/local/lib/gcc46'])
|
||||
env.Append(LINKFLAGS = ['-Wl,-rpath=/usr/local/lib/gcc46'])
|
||||
|
||||
if OSX:
|
||||
if USING_CLANG:
|
||||
env.Replace(CC= 'clang')
|
||||
env.Replace(CXX= 'clang++')
|
||||
env.Append(CXXFLAGS = ['-std=c++11', '-stdlib=libc++'])
|
||||
env.Append(LINKFLAGS='-stdlib=libc++')
|
||||
env['FRAMEWORKS'] = ['AppKit','Foundation']
|
||||
|
||||
if Linux:
|
||||
env.Append(CXXFLAGS = ['-std=c++11', '-stdlib=libstdc++'])
|
||||
env.Append(LINKFLAGS='-stdlib=libstdc++')
|
||||
|
||||
if OSX:
|
||||
env.Append(CXXFLAGS = ['-std=c++11', '-stdlib=libc++',
|
||||
'-Wno-deprecated-register'])
|
||||
env.Append(LINKFLAGS='-stdlib=libc++')
|
||||
env['FRAMEWORKS'] = ['AppKit','Foundation']
|
||||
|
||||
GCC_VERSION = re.split('\.', commands.getoutput(env['CXX'] + ' -dumpversion'))
|
||||
|
||||
@@ -98,12 +112,23 @@ BOOST_LIBS = [
|
||||
# We whitelist platforms where the non -mt version is linked with pthreads. This
|
||||
# can be verified with: ldd libboost_filesystem.* If a threading library is
|
||||
# included the platform can be whitelisted.
|
||||
if FreeBSD or Ubuntu or Archlinux:
|
||||
# if FreeBSD or Ubuntu or Archlinux or OSX:
|
||||
# if FreeBSD or Ubuntu or Archlinux:
|
||||
|
||||
if not (USING_CLANG and Linux) and (FreeBSD or Ubuntu or Archlinux or Debian or OSX):
|
||||
# non-mt libs do link with pthreads.
|
||||
env.Append(
|
||||
LIBS = BOOST_LIBS
|
||||
)
|
||||
elif Linux and USING_CLANG and Ubuntu:
|
||||
# It's likely going to be here if using boost 1.55
|
||||
boost_statics = [ ("/usr/lib/x86_64-linux-gnu/lib%s.a" % a) for a in
|
||||
BOOST_LIBS ]
|
||||
|
||||
if not all(os.path.exists(f) for f in boost_statics):
|
||||
# Else here
|
||||
boost_statics = [("/usr/lib/lib%s.a" % a) for a in BOOST_LIBS]
|
||||
|
||||
env.Append(LIBS = [File(f) for f in boost_statics])
|
||||
else:
|
||||
env.Append(
|
||||
LIBS = [l + '-mt' for l in BOOST_LIBS]
|
||||
@@ -124,11 +149,10 @@ else:
|
||||
#
|
||||
INCLUDE_PATHS = [
|
||||
'.',
|
||||
'src',
|
||||
'src/BeastConfig',
|
||||
'src/leveldb',
|
||||
'src/leveldb/port',
|
||||
'src/leveldb/include',
|
||||
'src/beast',
|
||||
'build/proto'
|
||||
]
|
||||
|
||||
@@ -156,18 +180,18 @@ COMPILED_FILES.extend (['src/ripple/beast/ripple_beastc.c'])
|
||||
# New-style Ripple unity sources
|
||||
#
|
||||
COMPILED_FILES.extend([
|
||||
'src/ripple/common/ripple_common.cpp',
|
||||
'src/ripple/http/ripple_http.cpp',
|
||||
'src/ripple/json/ripple_json.cpp',
|
||||
'src/ripple/peerfinder/ripple_peerfinder.cpp',
|
||||
'src/ripple/radmap/ripple_radmap.cpp',
|
||||
'src/ripple/resource/ripple_resource.cpp',
|
||||
'src/ripple/rocksdb/ripple_rocksdb.cpp',
|
||||
'src/ripple/rpc/ripple_rpc.cpp',
|
||||
'src/ripple/sitefiles/ripple_sitefiles.cpp',
|
||||
'src/ripple/sslutil/ripple_sslutil.cpp',
|
||||
'src/ripple/testoverlay/ripple_testoverlay.cpp',
|
||||
'src/ripple/types/ripple_types.cpp',
|
||||
'src/ripple/validators/ripple_validators.cpp'
|
||||
'src/ripple/validators/ripple_validators.cpp',
|
||||
'src/ripple/common/ripple_common.cpp',
|
||||
])
|
||||
|
||||
# ------------------------------
|
||||
@@ -183,12 +207,15 @@ COMPILED_FILES.extend([
|
||||
'src/ripple_app/ripple_app_pt6.cpp',
|
||||
'src/ripple_app/ripple_app_pt7.cpp',
|
||||
'src/ripple_app/ripple_app_pt8.cpp',
|
||||
'src/ripple_app/ripple_app_pt9.cpp',
|
||||
'src/ripple_basics/ripple_basics.cpp',
|
||||
'src/ripple_core/ripple_core.cpp',
|
||||
'src/ripple_data/ripple_data.cpp',
|
||||
'src/ripple_hyperleveldb/ripple_hyperleveldb.cpp',
|
||||
'src/ripple_leveldb/ripple_leveldb.cpp',
|
||||
'src/ripple_net/ripple_net.cpp',
|
||||
'src/ripple_overlay/ripple_overlay.cpp',
|
||||
'src/ripple_rpc/ripple_rpc.cpp',
|
||||
'src/ripple_websocket/ripple_websocket.cpp'
|
||||
])
|
||||
|
||||
@@ -227,7 +254,7 @@ env.Append(
|
||||
['rt'] if not OSX else [] +\
|
||||
[
|
||||
'z'
|
||||
]
|
||||
]
|
||||
)
|
||||
|
||||
# We prepend, in case there's another BOOST somewhere on the path
|
||||
@@ -238,23 +265,41 @@ if BOOST_HOME is not None:
|
||||
|
||||
if not OSX:
|
||||
env.Append(LINKFLAGS = [
|
||||
'-rdynamic', '-pthread',
|
||||
'-rdynamic',
|
||||
'-pthread',
|
||||
])
|
||||
|
||||
DEBUGFLAGS = ['-g', '-DDEBUG', '-D_DEBUG']
|
||||
|
||||
env.Append(CCFLAGS = ['-pthread', '-Wall', '-Wno-sign-compare', '-Wno-char-subscripts']+DEBUGFLAGS)
|
||||
env.Append(CXXFLAGS = ['-O1', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+DEBUGFLAGS)
|
||||
if not USING_CLANG:
|
||||
more_warnings = ['-Wno-unused-local-typedefs']
|
||||
else:
|
||||
# This disables the "You said it was a struct AND a class, wth is going on
|
||||
# warnings"
|
||||
more_warnings = ['-Wno-mismatched-tags']
|
||||
# This needs to be a CCFLAGS not a CXXFLAGS
|
||||
env.Append(CCFLAGS = more_warnings)
|
||||
|
||||
env.Append(CXXFLAGS = ['-O1','-pthread', '-Wno-invalid-offsetof', '-Wformat']+more_warnings+DEBUGFLAGS)
|
||||
|
||||
# RTTI is required for Beast and CountedObject.
|
||||
#
|
||||
env.Append(CXXFLAGS = ['-frtti'])
|
||||
|
||||
if (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) == 6):
|
||||
env.Append(CXXFLAGS = ['-std=c++0x'])
|
||||
elif (int(GCC_VERSION[0]) > 4 or (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) >= 7)):
|
||||
env.Append(CXXFLAGS = ['-std=c++11'])
|
||||
UBUNTU_GCC_48_INSTALL_STEPS = '''
|
||||
https://ripple.com/wiki/Ubuntu_build_instructions#Ubuntu_versions_older_than_13.10_:_Install_gcc_4.8'''
|
||||
|
||||
if not USING_CLANG:
|
||||
if (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) < 8):
|
||||
print "\nrippled, using c++11, requires g++ version >= 4.8 to compile"
|
||||
|
||||
if Ubuntu:
|
||||
print UBUNTU_GCC_48_INSTALL_STEPS
|
||||
|
||||
sys.exit(1)
|
||||
else:
|
||||
env.Append(CXXFLAGS = ['-std=c++11'])
|
||||
|
||||
# FreeBSD doesn't support O_DSYNC
|
||||
if FreeBSD:
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
// Copyright (c) 2013 The LevelDB Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#include "leveldb/db.h"
|
||||
#include "db/db_impl.h"
|
||||
#include "leveldb/cache.h"
|
||||
#include "util/testharness.h"
|
||||
#include "util/testutil.h"
|
||||
|
||||
namespace leveldb {
|
||||
|
||||
class AutoCompactTest {
|
||||
public:
|
||||
std::string dbname_;
|
||||
Cache* tiny_cache_;
|
||||
Options options_;
|
||||
DB* db_;
|
||||
|
||||
AutoCompactTest() {
|
||||
dbname_ = test::TmpDir() + "/autocompact_test";
|
||||
tiny_cache_ = NewLRUCache(100);
|
||||
options_.block_cache = tiny_cache_;
|
||||
DestroyDB(dbname_, options_);
|
||||
options_.create_if_missing = true;
|
||||
options_.compression = kNoCompression;
|
||||
ASSERT_OK(DB::Open(options_, dbname_, &db_));
|
||||
}
|
||||
|
||||
~AutoCompactTest() {
|
||||
delete db_;
|
||||
DestroyDB(dbname_, Options());
|
||||
delete tiny_cache_;
|
||||
}
|
||||
|
||||
std::string Key(int i) {
|
||||
char buf[100];
|
||||
snprintf(buf, sizeof(buf), "key%06d", i);
|
||||
return std::string(buf);
|
||||
}
|
||||
|
||||
uint64_t Size(const Slice& start, const Slice& limit) {
|
||||
Range r(start, limit);
|
||||
uint64_t size;
|
||||
db_->GetApproximateSizes(&r, 1, &size);
|
||||
return size;
|
||||
}
|
||||
|
||||
void DoReads(int n);
|
||||
};
|
||||
|
||||
static const int kValueSize = 200 * 1024;
|
||||
static const int kTotalSize = 100 * 1024 * 1024;
|
||||
static const int kCount = kTotalSize / kValueSize;
|
||||
|
||||
// Read through the first n keys repeatedly and check that they get
|
||||
// compacted (verified by checking the size of the key space).
|
||||
void AutoCompactTest::DoReads(int n) {
|
||||
std::string value(kValueSize, 'x');
|
||||
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
|
||||
|
||||
// Fill database
|
||||
for (int i = 0; i < kCount; i++) {
|
||||
ASSERT_OK(db_->Put(WriteOptions(), Key(i), value));
|
||||
}
|
||||
ASSERT_OK(dbi->TEST_CompactMemTable());
|
||||
|
||||
// Delete everything
|
||||
for (int i = 0; i < kCount; i++) {
|
||||
ASSERT_OK(db_->Delete(WriteOptions(), Key(i)));
|
||||
}
|
||||
ASSERT_OK(dbi->TEST_CompactMemTable());
|
||||
|
||||
// Get initial measurement of the space we will be reading.
|
||||
const int64_t initial_size = Size(Key(0), Key(n));
|
||||
const int64_t initial_other_size = Size(Key(n), Key(kCount));
|
||||
|
||||
// Read until size drops significantly.
|
||||
std::string limit_key = Key(n);
|
||||
for (int read = 0; true; read++) {
|
||||
ASSERT_LT(read, 100) << "Taking too long to compact";
|
||||
Iterator* iter = db_->NewIterator(ReadOptions());
|
||||
for (iter->SeekToFirst();
|
||||
iter->Valid() && iter->key().ToString() < limit_key;
|
||||
iter->Next()) {
|
||||
// Drop data
|
||||
}
|
||||
delete iter;
|
||||
// Wait a little bit to allow any triggered compactions to complete.
|
||||
Env::Default()->SleepForMicroseconds(1000000);
|
||||
uint64_t size = Size(Key(0), Key(n));
|
||||
fprintf(stderr, "iter %3d => %7.3f MB [other %7.3f MB]\n",
|
||||
read+1, size/1048576.0, Size(Key(n), Key(kCount))/1048576.0);
|
||||
if (size <= initial_size/10) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Verify that the size of the key space not touched by the reads
|
||||
// is pretty much unchanged.
|
||||
const int64_t final_other_size = Size(Key(n), Key(kCount));
|
||||
ASSERT_LE(final_other_size, initial_other_size + 1048576);
|
||||
ASSERT_GE(final_other_size, initial_other_size/5 - 1048576);
|
||||
}
|
||||
|
||||
TEST(AutoCompactTest, ReadAll) {
|
||||
DoReads(kCount);
|
||||
}
|
||||
|
||||
TEST(AutoCompactTest, ReadHalf) {
|
||||
DoReads(kCount/2);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return leveldb::test::RunAllTests();
|
||||
}
|
||||
@@ -60,39 +60,36 @@
|
||||
#
|
||||
# [ips]
|
||||
#
|
||||
# List of ips where the Ripple protocol is served. For a starter list,
|
||||
# you can copy entries from: https://ripple.com/ripple.txt
|
||||
# List of hostnames or ips where the Ripple protocol is served. For a starter
|
||||
# list, you can either copy entries from: https://ripple.com/ripple.txt or if
|
||||
# you prefer you can specify r.ripple.com 51235
|
||||
#
|
||||
# Domain names are not allowed. One ipv4 or ipv6 address per line. A port
|
||||
# may optionally be specified after adding a space to the address. By
|
||||
# convention, if known, IPs are listed in from most to least trusted.
|
||||
# One IPv4 address or domain names per line is allowed. A port may optionally
|
||||
# be specified after adding a space to the address. By convention, if known,
|
||||
# IPs are listed in from most to least trusted.
|
||||
#
|
||||
# Examples:
|
||||
# 192.168.0.1
|
||||
# 192.168.0.1 3939
|
||||
# 2001:0db8:0100:f101:0210:a4ff:fee3:9566
|
||||
# r.ripple.com 51235
|
||||
#
|
||||
# Here's the recent set of good, well known addresses:
|
||||
# This will give you a good, up-to-date list of addresses:
|
||||
#
|
||||
# [ips]
|
||||
# 54.225.112.220 51235
|
||||
# 54.225.123.13 51235
|
||||
# 54.227.239.106 51235
|
||||
# 107.21.251.218 51235
|
||||
# 184.73.226.101 51235
|
||||
# 23.23.201.55 51235
|
||||
# r.ripple.com 51235
|
||||
#
|
||||
#
|
||||
#
|
||||
# [ips_fixed]
|
||||
#
|
||||
# List of IP addresses to which rippled should always maintain peer
|
||||
# connections with. This is useful for manually forming private networks,
|
||||
# for example to configure a validation server that connects to the
|
||||
# List of IP addresses or hostnames to which rippled should always attempt to
|
||||
# maintain peer connections with. This is useful for manually forming private
|
||||
# networks, for example to configure a validation server that connects to the
|
||||
# Ripple network through a public-facing server, or for building a set
|
||||
# of cluster peers.
|
||||
#
|
||||
#
|
||||
# One IPv4 address or domain names per line is allowed. A port may optionally
|
||||
# be specified after adding a space to the address.
|
||||
#
|
||||
# [peer_ip]
|
||||
#
|
||||
@@ -494,6 +491,20 @@
|
||||
#
|
||||
#
|
||||
#
|
||||
# [fetch_depth]
|
||||
#
|
||||
# The number of past ledgers to serve to other peers that request historical
|
||||
# ledger data (or "full" for no limit).
|
||||
#
|
||||
# Servers that require low latency and high local performance may wish to
|
||||
# restrict the historical ledgers they are willing to serve. Setting this
|
||||
# below 32 can harm network stability as servers require easy access to
|
||||
# recent history to stay in sync. Values below 128 are not recommended.
|
||||
#
|
||||
# The default is: full
|
||||
#
|
||||
#
|
||||
#
|
||||
# [validation_seed]
|
||||
#
|
||||
# To perform validation, this section should contain either a validation seed
|
||||
@@ -799,15 +810,9 @@ time.nist.gov
|
||||
pool.ntp.org
|
||||
|
||||
# Where to find some other servers speaking the Ripple protocol.
|
||||
# This set of addresses is recent as of September 5, 2013
|
||||
#
|
||||
[ips]
|
||||
54.225.112.220 51235
|
||||
54.225.123.13 51235
|
||||
54.227.239.106 51235
|
||||
107.21.251.218 51235
|
||||
184.73.226.101 51235
|
||||
23.23.201.55 51235
|
||||
r.ripple.com 51235
|
||||
|
||||
# These validators are taken from the v0.16 release notes on the wiki:
|
||||
# https://ripple.com/wiki/Latest_rippled_release_notes
|
||||
|
||||
@@ -22,9 +22,6 @@ David Features:
|
||||
|
||||
- std::priority_queue for DeadlineTimer
|
||||
|
||||
- Change ProxyInfo to use IPAddress, get rid of IPv4Address from the parsing
|
||||
code
|
||||
|
||||
- Validators should delay the application of newly downloaded lists from
|
||||
sources, to mitigate the effects of attacks. Unless there's no validators
|
||||
in the list.
|
||||
@@ -34,7 +31,7 @@ David Features:
|
||||
|
||||
- Look into using CMake
|
||||
|
||||
- IPv6 support in IPAddress
|
||||
- IPv6 support in IP::Endpoint
|
||||
|
||||
- Configuration list for Jenkins
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
// Copyright (c) 2013 The LevelDB Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
// Test for issue 200: when iterator switches direction from backward
|
||||
// to forward, the current key can be yielded unexpectedly if a new
|
||||
// mutation has been added just before the current key.
|
||||
|
||||
#include "leveldb/db.h"
|
||||
#include "util/testharness.h"
|
||||
|
||||
namespace leveldb {
|
||||
|
||||
class Issue200 { };
|
||||
|
||||
TEST(Issue200, Test) {
|
||||
// Get rid of any state from an old run.
|
||||
std::string dbpath = test::TmpDir() + "/leveldb_issue200_test";
|
||||
DestroyDB(dbpath, Options());
|
||||
|
||||
DB *db;
|
||||
Options options;
|
||||
options.create_if_missing = true;
|
||||
ASSERT_OK(DB::Open(options, dbpath, &db));
|
||||
|
||||
WriteOptions write_options;
|
||||
ASSERT_OK(db->Put(write_options, "1", "b"));
|
||||
ASSERT_OK(db->Put(write_options, "2", "c"));
|
||||
ASSERT_OK(db->Put(write_options, "3", "d"));
|
||||
ASSERT_OK(db->Put(write_options, "4", "e"));
|
||||
ASSERT_OK(db->Put(write_options, "5", "f"));
|
||||
|
||||
ReadOptions read_options;
|
||||
Iterator *iter = db->NewIterator(read_options);
|
||||
|
||||
// Add an element that should not be reflected in the iterator.
|
||||
ASSERT_OK(db->Put(write_options, "25", "cd"));
|
||||
|
||||
iter->Seek("5");
|
||||
ASSERT_EQ(iter->key().ToString(), "5");
|
||||
iter->Prev();
|
||||
ASSERT_EQ(iter->key().ToString(), "4");
|
||||
iter->Prev();
|
||||
ASSERT_EQ(iter->key().ToString(), "3");
|
||||
iter->Next();
|
||||
ASSERT_EQ(iter->key().ToString(), "4");
|
||||
iter->Next();
|
||||
ASSERT_EQ(iter->key().ToString(), "5");
|
||||
|
||||
delete iter;
|
||||
delete db;
|
||||
DestroyDB(dbpath, options);
|
||||
}
|
||||
|
||||
} // namespace leveldb
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return leveldb::test::RunAllTests();
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
"test": "mocha test/websocket-test.js test/server-test.js test/*-test.{js,coffee}"
|
||||
},
|
||||
|
||||
"repository": {
|
||||
@@ -31,4 +31,4 @@
|
||||
},
|
||||
|
||||
"readmeFilename": "README.md"
|
||||
}
|
||||
}
|
||||
@@ -184,19 +184,4 @@
|
||||
#define RIPPLE_USE_VALIDATORS 0
|
||||
#endif
|
||||
|
||||
// Turning this on will use the new PeerFinder logic to establish connections
|
||||
// to other peers. Even with this off, PeerFinder will still send mtENDPOINTS
|
||||
// messages as needed, and collect legacy IP endpoint information.
|
||||
//
|
||||
#ifndef RIPPLE_USE_PEERFINDER
|
||||
#define RIPPLE_USE_PEERFINDER 0
|
||||
#endif
|
||||
|
||||
// Here temporarily
|
||||
// Controls whether or not the new RPC::Manager logic will be
|
||||
// used to invoke RPC commands before they pass to the original code.
|
||||
#ifndef RIPPLE_USE_RPC_SERVICE_MANAGER
|
||||
#define RIPPLE_USE_RPC_SERVICE_MANAGER 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -8,7 +8,7 @@
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PreprocessorDefinitions>BEAST_COMPILING_STATIC_LIBARARY=1;_CRTDBG_MAP_ALLOC;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>BEAST_COMPILING_STATIC_LIBARARY=1;_CRTDBG_MAP_ALLOC;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalIncludeDirectories>$(RepoDir)\config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -83,14 +83,24 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\beast\Arithmetic.h" />
|
||||
<ClInclude Include="..\..\beast\Asio.h" />
|
||||
<ClInclude Include="..\..\beast\asio\abstract_socket.h" />
|
||||
<ClInclude Include="..\..\beast\asio\bind_handler.h" />
|
||||
<ClInclude Include="..\..\beast\asio\buffer_sequence.h" />
|
||||
<ClInclude Include="..\..\beast\asio\io_latency_probe.h" />
|
||||
<ClInclude Include="..\..\beast\asio\IPAddressConversion.h" />
|
||||
<ClInclude Include="..\..\beast\asio\placeholders.h" />
|
||||
<ClInclude Include="..\..\beast\asio\shared_handler.h" />
|
||||
<ClInclude Include="..\..\beast\asio\socket_wrapper.h" />
|
||||
<ClInclude Include="..\..\beast\asio\wrap_handler.h" />
|
||||
<ClInclude Include="..\..\beast\Atomic.h" />
|
||||
<ClInclude Include="..\..\beast\Boost.h" />
|
||||
<ClInclude Include="..\..\beast\boost\ErrorCode.h" />
|
||||
<ClInclude Include="..\..\beast\ByteOrder.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\chrono_io.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\CPUMeter.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\abstract_clock.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\basic_seconds_clock.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\chrono_io.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\chrono_util.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\CPUMeter.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\manual_clock.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\ratio_io.h" />
|
||||
<ClInclude Include="..\..\beast\chrono\RelativeTime.h" />
|
||||
@@ -113,6 +123,21 @@
|
||||
<ClInclude Include="..\..\beast\config\SelectPlatformConfig.h" />
|
||||
<ClInclude Include="..\..\beast\config\SelectStdlibConfig.h" />
|
||||
<ClInclude Include="..\..\beast\config\StandardConfig.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_container_utility.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_container.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_map.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_multimap.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_multiset.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_set.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_unordered_map.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_unordered_multimap.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_unordered_multiset.h" />
|
||||
<ClInclude Include="..\..\beast\container\aged_unordered_set.h" />
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_associative_container.h" />
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_ordered_container.h" />
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_container_iterator.h" />
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_unordered_container.h" />
|
||||
<ClInclude Include="..\..\beast\container\buffer_view.h" />
|
||||
<ClInclude Include="..\..\beast\Crypto.h" />
|
||||
<ClInclude Include="..\..\beast\crypto\BinaryEncoding.h" />
|
||||
<ClInclude Include="..\..\beast\crypto\impl\sha2\sha2.h" />
|
||||
@@ -121,14 +146,23 @@
|
||||
<ClInclude Include="..\..\beast\crypto\UnsignedInteger.h" />
|
||||
<ClInclude Include="..\..\beast\crypto\UnsignedIntegerCalc.h" />
|
||||
<ClInclude Include="..\..\beast\CStdInt.h" />
|
||||
<ClInclude Include="..\..\beast\cxx14\algorithm.h" />
|
||||
<ClInclude Include="..\..\beast\cxx14\config.h" />
|
||||
<ClInclude Include="..\..\beast\cxx14\functional.h" />
|
||||
<ClInclude Include="..\..\beast\cxx14\memory.h" />
|
||||
<ClInclude Include="..\..\beast\cxx14\type_traits.h" />
|
||||
<ClInclude Include="..\..\beast\cxx14\utility.h" />
|
||||
<ClInclude Include="..\..\beast\cyclic_iterator.h" />
|
||||
<ClInclude Include="..\..\beast\FixedArray.h" />
|
||||
<ClInclude Include="..\..\beast\HeapBlock.h" />
|
||||
<ClInclude Include="..\..\beast\HTTP.h" />
|
||||
<ClInclude Include="..\..\beast\http\impl\http-parser\http_parser.h" />
|
||||
<ClInclude Include="..\..\beast\http\impl\http_parser.h" />
|
||||
<ClInclude Include="..\..\beast\http\ParsedURL.h" />
|
||||
<ClInclude Include="..\..\beast\http\URL.h" />
|
||||
<ClInclude Include="..\..\beast\Insight.h" />
|
||||
<ClInclude Include="..\..\beast\insight\Base.h" />
|
||||
<ClInclude Include="..\..\beast\insight\BaseImpl.h" />
|
||||
<ClInclude Include="..\..\beast\insight\Collector.h" />
|
||||
<ClInclude Include="..\..\beast\insight\Counter.h" />
|
||||
<ClInclude Include="..\..\beast\insight\CounterImpl.h" />
|
||||
@@ -136,6 +170,8 @@
|
||||
<ClInclude Include="..\..\beast\insight\EventImpl.h" />
|
||||
<ClInclude Include="..\..\beast\insight\Gauge.h" />
|
||||
<ClInclude Include="..\..\beast\insight\GaugeImpl.h" />
|
||||
<ClInclude Include="..\..\beast\insight\Group.h" />
|
||||
<ClInclude Include="..\..\beast\insight\Groups.h" />
|
||||
<ClInclude Include="..\..\beast\insight\Hook.h" />
|
||||
<ClInclude Include="..\..\beast\insight\HookImpl.h" />
|
||||
<ClInclude Include="..\..\beast\insight\Meter.h" />
|
||||
@@ -150,8 +186,12 @@
|
||||
<ClInclude Include="..\..\beast\mpl\IsCallPossible.h" />
|
||||
<ClInclude Include="..\..\beast\Net.h" />
|
||||
<ClInclude Include="..\..\beast\net\BufferType.h" />
|
||||
<ClInclude Include="..\..\beast\net\detail\Parse.h" />
|
||||
<ClInclude Include="..\..\beast\net\DynamicBuffer.h" />
|
||||
<ClInclude Include="..\..\beast\net\IPAddress.h" />
|
||||
<ClInclude Include="..\..\beast\net\IPAddressV4.h" />
|
||||
<ClInclude Include="..\..\beast\net\IPAddressV6.h" />
|
||||
<ClInclude Include="..\..\beast\net\IPEndpoint.h" />
|
||||
<ClInclude Include="..\..\beast\SafeBool.h" />
|
||||
<ClInclude Include="..\..\beast\SmartPtr.h" />
|
||||
<ClInclude Include="..\..\beast\smart_ptr\AbstractObject.h" />
|
||||
@@ -160,8 +200,6 @@
|
||||
<ClInclude Include="..\..\beast\smart_ptr\SharedObject.h" />
|
||||
<ClInclude Include="..\..\beast\smart_ptr\SharedPtr.h" />
|
||||
<ClInclude Include="..\..\beast\StaticAssert.h" />
|
||||
<ClInclude Include="..\..\beast\STL.h" />
|
||||
<ClInclude Include="..\..\beast\stl\shared_ptr.h" />
|
||||
<ClInclude Include="..\..\beast\Strings.h" />
|
||||
<ClInclude Include="..\..\beast\strings\CharacterFunctions.h" />
|
||||
<ClInclude Include="..\..\beast\strings\CharPointer_ASCII.h" />
|
||||
@@ -195,12 +233,11 @@
|
||||
<ClInclude Include="..\..\beast\type_traits\IntegralConstant.h" />
|
||||
<ClInclude Include="..\..\beast\type_traits\IsIntegral.h" />
|
||||
<ClInclude Include="..\..\beast\type_traits\IsSigned.h" />
|
||||
<ClInclude Include="..\..\beast\type_traits\RemoveSigned.h" />
|
||||
<ClInclude Include="..\..\beast\type_traits\maybe_const.h" />
|
||||
<ClInclude Include="..\..\beast\Uncopyable.h" />
|
||||
<ClInclude Include="..\..\beast\Utility.h" />
|
||||
<ClInclude Include="..\..\beast\utility\BaseFromMember.h" />
|
||||
<ClInclude Include="..\..\beast\utility\Debug.h" />
|
||||
<ClInclude Include="..\..\beast\utility\EnableIf.h" />
|
||||
<ClInclude Include="..\..\beast\utility\empty_base_optimization.h" />
|
||||
<ClInclude Include="..\..\beast\utility\Error.h" />
|
||||
<ClInclude Include="..\..\beast\utility\hash_pair.h" />
|
||||
<ClInclude Include="..\..\beast\utility\Journal.h" />
|
||||
@@ -209,15 +246,7 @@
|
||||
<ClInclude Include="..\..\beast\utility\StaticObject.h" />
|
||||
<ClInclude Include="..\..\beast\Version.h" />
|
||||
<ClInclude Include="..\..\config\BeastConfig.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\AbstractHandler.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\AsyncObject.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\ComposedAsyncOperation.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\WrapHandler.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandler.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerAllocator.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerPtr.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerType.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\basics\BuffersType.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\basics\FixedInputBuffer.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\basics\PeerRole.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\basics\SharedArg.h" />
|
||||
@@ -241,10 +270,6 @@
|
||||
<ClInclude Include="..\..\modules\beast_asio\protocol\HandshakeDetector.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\protocol\InputParser.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\protocol\PrefilledReadStream.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\sockets\Socket.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketBase.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapper.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapperStrand.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\system\BoostIncludes.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\system\OpenSSLIncludes.h" />
|
||||
<ClInclude Include="..\..\modules\beast_asio\tests\TestPeer.h" />
|
||||
@@ -293,12 +318,10 @@
|
||||
<ClInclude Include="..\..\modules\beast_core\maths\Math.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\maths\Random.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\maths\Range.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\maths\uint24.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\memory\CacheLine.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\memory\MemoryAlignment.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\memory\MemoryBlock.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\memory\OptionalScopedPointer.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\memory\SharedFunction.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\memory\SharedSingleton.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\misc\Main.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\misc\Result.h" />
|
||||
@@ -333,7 +356,6 @@
|
||||
<ClInclude Include="..\..\modules\beast_core\text\StringArray.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\text\StringPairArray.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\text\StringPool.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\text\TextDiff.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\threads\ChildProcess.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\threads\CriticalSection.h" />
|
||||
<ClInclude Include="..\..\modules\beast_core\threads\DynamicLibrary.h" />
|
||||
@@ -398,6 +420,12 @@
|
||||
<ClInclude Include="..\..\modules\beast_sqlite\sqlite\sqlite3ext.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\beast\asio\abstract_socket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\asio\Asio.cpp" />
|
||||
<ClCompile Include="..\..\beast\asio\impl\IPAddressConversion.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@@ -407,6 +435,12 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\boost\Boost.cpp" />
|
||||
<ClCompile Include="..\..\beast\chrono\Chrono.cpp" />
|
||||
<ClCompile Include="..\..\beast\chrono\impl\basic_seconds_clock.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\chrono\impl\chrono_io.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -431,6 +465,19 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\container\Container.cpp" />
|
||||
<ClCompile Include="..\..\beast\container\impl\aged_associative_container.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\container\tests\buffer_view.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\crypto\Crypto.cpp" />
|
||||
<ClCompile Include="..\..\beast\crypto\impl\BinaryEncoding.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@@ -474,6 +521,13 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\cxx14\cxx14.cpp" />
|
||||
<ClCompile Include="..\..\beast\cxx14\tests\integer_sequence.test.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\http\HTTP.cpp" />
|
||||
<ClCompile Include="..\..\beast\http\impl\http_parser.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -523,6 +577,18 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\insight\impl\Group.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\insight\impl\Groups.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\insight\impl\Hook.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -560,6 +626,24 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\impl\IPAddressV4.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\impl\IPAddressV6.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\impl\IPEndpoint.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\Net.cpp" />
|
||||
<ClCompile Include="..\..\beast\smart_ptr\impl\AbstractObject.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@@ -568,7 +652,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\smart_ptr\SmartPtr.cpp" />
|
||||
<ClCompile Include="..\..\beast\stl\STL.cpp" />
|
||||
<ClCompile Include="..\..\beast\strings\impl\CharacterFunctions.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -619,6 +702,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\threads\Threads.cpp" />
|
||||
<ClCompile Include="..\..\beast\utility\impl\Assert.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\utility\impl\Debug.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -656,12 +745,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\utility\Utility.cpp" />
|
||||
<ClCompile Include="..\..\modules\beast_asio\async\SharedHandler.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\basics\PeerRole.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -739,18 +822,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\sockets\Socket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\sockets\SocketBase.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\system\BoostUnitTests.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1194,12 +1265,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_core\text\TextDiff.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_core\threads\ChildProcess.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
@@ -1444,31 +1509,32 @@
|
||||
<ProjectGuid>{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>beast</RootNamespace>
|
||||
<IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@@ -159,9 +159,6 @@
|
||||
<Filter Include="beast_asio">
|
||||
<UniqueIdentifier>{54bbe439-76c3-4781-becc-9c70a2be6d82}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast_asio\sockets">
|
||||
<UniqueIdentifier>{af535ad5-a06c-462f-8ac0-8207a708e032}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast_asio\system">
|
||||
<UniqueIdentifier>{c7a576bb-27b2-486e-aa14-3c51aa86c50f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -195,9 +192,6 @@
|
||||
<Filter Include="beast">
|
||||
<UniqueIdentifier>{92d1bb42-289a-4444-85c7-cb87540f2fff}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\intrusive">
|
||||
<UniqueIdentifier>{8832eb52-53f9-4850-8dc9-1d579a386a0e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\mpl">
|
||||
<UniqueIdentifier>{5904368f-a0f2-4d26-a031-8cbe4448dc3f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -252,9 +246,6 @@
|
||||
<Filter Include="beast\config\platform">
|
||||
<UniqueIdentifier>{38c81e1f-f831-4632-af45-6340683f3346}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\config\stdlib">
|
||||
<UniqueIdentifier>{7243e5e5-ad7e-4d81-8444-d545919e850c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\smart_ptr">
|
||||
<UniqueIdentifier>{4e9c54da-1581-41d7-ac75-48140e4a13d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -279,9 +270,6 @@
|
||||
<Filter Include="beast\smart_ptr\impl">
|
||||
<UniqueIdentifier>{df4f2935-13a1-4afe-90cc-d86472ec2466}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\stl">
|
||||
<UniqueIdentifier>{793e2d61-14f6-4fa1-a17f-af6bbec13ba1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\insight">
|
||||
<UniqueIdentifier>{174b9125-76a7-4796-be97-79c2dcc751f1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -297,6 +285,30 @@
|
||||
<Filter Include="beast\crypto\impl\sha2">
|
||||
<UniqueIdentifier>{44489531-f44a-439a-a6ea-d32c252b1e8b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\net\detail">
|
||||
<UniqueIdentifier>{43cc0f2a-9905-4081-8104-48d2c4be9e7e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\container">
|
||||
<UniqueIdentifier>{48c7ee12-704c-42cb-99ea-9a486bb4b57e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\container\impl">
|
||||
<UniqueIdentifier>{e30eda19-95b4-4831-b86a-ee5fae88abd2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\container\detail">
|
||||
<UniqueIdentifier>{a4dca8cc-7d1f-4353-b7e1-15eab33e8bd4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\intrusive">
|
||||
<UniqueIdentifier>{8832eb52-53f9-4850-8dc9-1d579a386a0e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\cxx14">
|
||||
<UniqueIdentifier>{5745a887-7df8-4059-87ea-e0c7eea77a9b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\container\tests">
|
||||
<UniqueIdentifier>{4b468051-9e97-4548-a5f0-469425c3b603}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="beast\cxx14\tests">
|
||||
<UniqueIdentifier>{1271ee71-5754-46ef-845b-84e53eed11c0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\modules\beast_core\beast_core.h">
|
||||
@@ -452,9 +464,6 @@
|
||||
<ClInclude Include="..\..\modules\beast_core\text\StringPool.h">
|
||||
<Filter>beast_core\text</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_core\text\TextDiff.h">
|
||||
<Filter>beast_core\text</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_core\threads\ChildProcess.h">
|
||||
<Filter>beast_core\threads</Filter>
|
||||
</ClInclude>
|
||||
@@ -638,9 +647,6 @@
|
||||
<ClInclude Include="..\..\modules\beast_core\diagnostic\SemanticVersion.h">
|
||||
<Filter>beast_core\diagnostic</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_core\maths\uint24.h">
|
||||
<Filter>beast_core\maths</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_core\diagnostic\MeasureFunctionCallTime.h">
|
||||
<Filter>beast_core\diagnostic</Filter>
|
||||
</ClInclude>
|
||||
@@ -674,9 +680,6 @@
|
||||
<ClInclude Include="..\..\modules\beast_core\maths\Math.h">
|
||||
<Filter>beast_core\maths</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapperStrand.h">
|
||||
<Filter>beast_asio\sockets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\basics\SSLContext.h">
|
||||
<Filter>beast_asio\basics</Filter>
|
||||
</ClInclude>
|
||||
@@ -704,36 +707,12 @@
|
||||
<ClInclude Include="..\..\modules\beast_core\system\SystemStats.h">
|
||||
<Filter>beast_core\system</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\ComposedAsyncOperation.h">
|
||||
<Filter>beast_asio\async</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandler.h">
|
||||
<Filter>beast_asio\async</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerAllocator.h">
|
||||
<Filter>beast_asio\async</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerPtr.h">
|
||||
<Filter>beast_asio\async</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerType.h">
|
||||
<Filter>beast_asio\async</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\basics\FixedInputBuffer.h">
|
||||
<Filter>beast_asio\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\basics\PeerRole.h">
|
||||
<Filter>beast_asio\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\sockets\Socket.h">
|
||||
<Filter>beast_asio\sockets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketBase.h">
|
||||
<Filter>beast_asio\sockets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapper.h">
|
||||
<Filter>beast_asio\sockets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\system\OpenSSLIncludes.h">
|
||||
<Filter>beast_asio\system</Filter>
|
||||
</ClInclude>
|
||||
@@ -818,9 +797,6 @@
|
||||
<ClInclude Include="..\..\modules\beast_asio\http\HTTPParserImpl.h">
|
||||
<Filter>beast_asio\http</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\basics\BuffersType.h">
|
||||
<Filter>beast_asio\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_core\memory\SharedSingleton.h">
|
||||
<Filter>beast_core\memory</Filter>
|
||||
</ClInclude>
|
||||
@@ -833,9 +809,6 @@
|
||||
<ClInclude Include="..\..\modules\beast_core\diagnostic\FatalError.h">
|
||||
<Filter>beast_core\diagnostic</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_core\memory\SharedFunction.h">
|
||||
<Filter>beast_core\memory</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\Config.h">
|
||||
<Filter>beast</Filter>
|
||||
</ClInclude>
|
||||
@@ -860,12 +833,6 @@
|
||||
<ClInclude Include="..\..\beast\type_traits\IsIntegral.h">
|
||||
<Filter>beast\type_traits</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\type_traits\RemoveSigned.h">
|
||||
<Filter>beast\type_traits</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\utility\EnableIf.h">
|
||||
<Filter>beast\utility</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\utility\Journal.h">
|
||||
<Filter>beast\utility</Filter>
|
||||
</ClInclude>
|
||||
@@ -986,18 +953,9 @@
|
||||
<ClInclude Include="..\..\beast\crypto\Sha256.h">
|
||||
<Filter>beast\crypto</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\WrapHandler.h">
|
||||
<Filter>beast_asio\async</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\modules\beast_asio\async\AbstractHandler.h">
|
||||
<Filter>beast_asio\async</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\Chrono.h">
|
||||
<Filter>beast</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\RelativeTime.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\SafeBool.h">
|
||||
<Filter>beast</Filter>
|
||||
</ClInclude>
|
||||
@@ -1065,12 +1023,6 @@
|
||||
<ClInclude Include="..\..\modules\beast_asio\http\HTTPResponseParser.h">
|
||||
<Filter>beast_asio\http</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\ScopedTimeInterval.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\CPUMeter.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\smart_ptr\SharedObject.h">
|
||||
<Filter>beast\smart_ptr</Filter>
|
||||
</ClInclude>
|
||||
@@ -1143,12 +1095,6 @@
|
||||
<ClInclude Include="..\..\beast\threads\ScopedWrapperContext.h">
|
||||
<Filter>beast\threads</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\utility\BaseFromMember.h">
|
||||
<Filter>beast\utility</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\net\IPAddress.h">
|
||||
<Filter>beast\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\Asio.h">
|
||||
<Filter>beast</Filter>
|
||||
</ClInclude>
|
||||
@@ -1161,12 +1107,6 @@
|
||||
<ClInclude Include="..\..\beast\smart_ptr\AbstractObject.h">
|
||||
<Filter>beast\smart_ptr</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\stl\shared_ptr.h">
|
||||
<Filter>beast\stl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\STL.h">
|
||||
<Filter>beast</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\Insight.h">
|
||||
<Filter>beast</Filter>
|
||||
</ClInclude>
|
||||
@@ -1227,21 +1167,162 @@
|
||||
<ClInclude Include="..\..\beast\crypto\UnsignedIntegerCalc.h">
|
||||
<Filter>beast\crypto</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\utility\hash_pair.h">
|
||||
<Filter>beast\utility</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\asio\io_latency_probe.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\insight\Base.h">
|
||||
<Filter>beast\insight</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\insight\BaseImpl.h">
|
||||
<Filter>beast\insight</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\insight\Group.h">
|
||||
<Filter>beast\insight</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\insight\Groups.h">
|
||||
<Filter>beast\insight</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\net\detail\Parse.h">
|
||||
<Filter>beast\net\detail</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\net\IPAddress.h">
|
||||
<Filter>beast\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\net\IPAddressV4.h">
|
||||
<Filter>beast\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\net\IPAddressV6.h">
|
||||
<Filter>beast\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\net\IPEndpoint.h">
|
||||
<Filter>beast\net</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\abstract_clock.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\basic_seconds_clock.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\chrono_io.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\chrono_util.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\CPUMeter.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\manual_clock.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\ratio_io.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\chrono\chrono_io.h">
|
||||
<ClInclude Include="..\..\beast\chrono\RelativeTime.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\utility\hash_pair.h">
|
||||
<ClInclude Include="..\..\beast\chrono\ScopedTimeInterval.h">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\type_traits\maybe_const.h">
|
||||
<Filter>beast\type_traits</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\utility\empty_base_optimization.h">
|
||||
<Filter>beast\utility</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_associative_container.h">
|
||||
<Filter>beast\container\detail</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_container_iterator.h">
|
||||
<Filter>beast\container\detail</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_map.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_multimap.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_multiset.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_set.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_unordered_map.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_unordered_multimap.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_unordered_multiset.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_unordered_set.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_ordered_container.h">
|
||||
<Filter>beast\container\detail</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_unordered_container.h">
|
||||
<Filter>beast\container\detail</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\detail\aged_associative_container.h">
|
||||
<Filter>beast\container\detail</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_container_utility.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\aged_container.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\cxx14\type_traits.h">
|
||||
<Filter>beast\cxx14</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\cxx14\functional.h">
|
||||
<Filter>beast\cxx14</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\cxx14\config.h">
|
||||
<Filter>beast\cxx14</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\cxx14\algorithm.h">
|
||||
<Filter>beast\cxx14</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\cxx14\memory.h">
|
||||
<Filter>beast\cxx14</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\container\buffer_view.h">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\cxx14\utility.h">
|
||||
<Filter>beast\cxx14</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\asio\abstract_socket.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\asio\bind_handler.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\asio\buffer_sequence.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\asio\placeholders.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\asio\shared_handler.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\asio\socket_wrapper.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\asio\wrap_handler.h">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\beast\http\impl\http_parser.h">
|
||||
<Filter>beast\http\impl</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\modules\beast_core\containers\DynamicObject.cpp">
|
||||
@@ -1388,9 +1469,6 @@
|
||||
<ClCompile Include="..\..\modules\beast_core\text\StringPool.cpp">
|
||||
<Filter>beast_core\text</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_core\text\TextDiff.cpp">
|
||||
<Filter>beast_core\text</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_core\threads\ChildProcess.cpp">
|
||||
<Filter>beast_core\threads</Filter>
|
||||
</ClCompile>
|
||||
@@ -1556,18 +1634,9 @@
|
||||
<ClCompile Include="..\..\modules\beast_core\system\SystemStats.cpp">
|
||||
<Filter>beast_core\system</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\async\SharedHandler.cpp">
|
||||
<Filter>beast_asio\async</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\basics\PeerRole.cpp">
|
||||
<Filter>beast_asio\basics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\sockets\Socket.cpp">
|
||||
<Filter>beast_asio\sockets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\sockets\SocketBase.cpp">
|
||||
<Filter>beast_asio\sockets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\beast_asio\system\BoostUnitTests.cpp">
|
||||
<Filter>beast_asio\system</Filter>
|
||||
</ClCompile>
|
||||
@@ -1700,9 +1769,6 @@
|
||||
<ClCompile Include="..\..\beast\chrono\impl\RelativeTime.cpp">
|
||||
<Filter>beast\chrono\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\chrono\Chrono.cpp">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\utility\impl\Debug.cpp">
|
||||
<Filter>beast\utility\impl</Filter>
|
||||
</ClCompile>
|
||||
@@ -1757,9 +1823,6 @@
|
||||
<ClCompile Include="..\..\beast\utility\impl\PropertyStream.cpp">
|
||||
<Filter>beast\utility\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\impl\IPAddress.cpp">
|
||||
<Filter>beast\net\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\asio\Asio.cpp">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClCompile>
|
||||
@@ -1772,9 +1835,6 @@
|
||||
<ClCompile Include="..\..\beast\smart_ptr\impl\AbstractObject.cpp">
|
||||
<Filter>beast\smart_ptr\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\stl\STL.cpp">
|
||||
<Filter>beast\stl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\insight\Insight.cpp">
|
||||
<Filter>beast\insight</Filter>
|
||||
</ClCompile>
|
||||
@@ -1805,6 +1865,51 @@
|
||||
<ClCompile Include="..\..\beast\crypto\impl\UnsignedInteger.cpp">
|
||||
<Filter>beast\crypto\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\insight\impl\Group.cpp">
|
||||
<Filter>beast\insight\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\insight\impl\Groups.cpp">
|
||||
<Filter>beast\insight\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\impl\IPAddress.cpp">
|
||||
<Filter>beast\net\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\impl\IPAddressV4.cpp">
|
||||
<Filter>beast\net\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\impl\IPAddressV6.cpp">
|
||||
<Filter>beast\net\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\net\impl\IPEndpoint.cpp">
|
||||
<Filter>beast\net\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\utility\impl\Assert.cpp">
|
||||
<Filter>beast\utility\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\chrono\Chrono.cpp">
|
||||
<Filter>beast\chrono</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\chrono\impl\basic_seconds_clock.cpp">
|
||||
<Filter>beast\chrono\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\container\Container.cpp">
|
||||
<Filter>beast\container</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\container\impl\aged_associative_container.cpp">
|
||||
<Filter>beast\container\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\container\tests\buffer_view.test.cpp">
|
||||
<Filter>beast\container\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\cxx14\cxx14.cpp">
|
||||
<Filter>beast\cxx14</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\cxx14\tests\integer_sequence.test.cpp">
|
||||
<Filter>beast\cxx14\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\beast\asio\abstract_socket.cpp">
|
||||
<Filter>beast\asio</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\TODO.txt">
|
||||
@@ -20,6 +20,4 @@
|
||||
#ifndef BEAST_ASIO_H_INCLUDED
|
||||
#define BEAST_ASIO_H_INCLUDED
|
||||
|
||||
#include "asio/IPAddressConversion.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -207,6 +207,9 @@ private:
|
||||
#define BEAST_64BIT_ATOMICS_UNAVAILABLE 1
|
||||
#endif
|
||||
|
||||
#elif BEAST_CLANG && BEAST_LINUX
|
||||
#define BEAST_ATOMICS_GCC 1
|
||||
|
||||
//==============================================================================
|
||||
#elif BEAST_GCC
|
||||
#define BEAST_ATOMICS_GCC 1 // GCC with intrinsics
|
||||
@@ -297,8 +300,16 @@ template <typename Type>
|
||||
inline Type Atomic<Type>::operator+= (const Type amountToAdd) noexcept
|
||||
{
|
||||
#if BEAST_ATOMICS_MAC
|
||||
# ifdef __clang__
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wint-to-void-pointer-cast"
|
||||
# pragma clang diagnostic ignored "-Wint-to-pointer-cast"
|
||||
# endif
|
||||
return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) castTo32Bit (amountToAdd), (BEAST_MAC_ATOMICS_VOLATILE int32_t*) &value)
|
||||
: (Type) OSAtomicAdd64Barrier ((int64_t) amountToAdd, (BEAST_MAC_ATOMICS_VOLATILE int64_t*) &value);
|
||||
# ifdef __clang__
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
#elif BEAST_ATOMICS_WINDOWS
|
||||
return sizeof (Type) == 4 ? (Type) (beast_InterlockedExchangeAdd ((volatile long*) &value, (long) amountToAdd) + (long) amountToAdd)
|
||||
: (Type) (beast_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) amountToAdd) + (__int64) amountToAdd);
|
||||
@@ -317,13 +328,21 @@ template <typename Type>
|
||||
inline Type Atomic<Type>::operator++() noexcept
|
||||
{
|
||||
#if BEAST_ATOMICS_MAC
|
||||
# ifdef __clang__
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wint-to-void-pointer-cast"
|
||||
# pragma clang diagnostic ignored "-Wint-to-pointer-cast"
|
||||
# endif
|
||||
return sizeof (Type) == 4 ? (Type) OSAtomicIncrement32Barrier ((BEAST_MAC_ATOMICS_VOLATILE int32_t*) &value)
|
||||
: (Type) OSAtomicIncrement64Barrier ((BEAST_MAC_ATOMICS_VOLATILE int64_t*) &value);
|
||||
# ifdef __clang__
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
#elif BEAST_ATOMICS_WINDOWS
|
||||
return sizeof (Type) == 4 ? (Type) beast_InterlockedIncrement ((volatile long*) &value)
|
||||
: (Type) beast_InterlockedIncrement64 ((volatile __int64*) &value);
|
||||
#elif BEAST_ATOMICS_GCC
|
||||
return (Type) __sync_add_and_fetch (&value, 1);
|
||||
return (Type) __sync_add_and_fetch (&value, (Type) 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -331,13 +350,21 @@ template <typename Type>
|
||||
inline Type Atomic<Type>::operator--() noexcept
|
||||
{
|
||||
#if BEAST_ATOMICS_MAC
|
||||
# ifdef __clang__
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wint-to-void-pointer-cast"
|
||||
# pragma clang diagnostic ignored "-Wint-to-pointer-cast"
|
||||
# endif
|
||||
return sizeof (Type) == 4 ? (Type) OSAtomicDecrement32Barrier ((BEAST_MAC_ATOMICS_VOLATILE int32_t*) &value)
|
||||
: (Type) OSAtomicDecrement64Barrier ((BEAST_MAC_ATOMICS_VOLATILE int64_t*) &value);
|
||||
# ifdef __clang__
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
#elif BEAST_ATOMICS_WINDOWS
|
||||
return sizeof (Type) == 4 ? (Type) beast_InterlockedDecrement ((volatile long*) &value)
|
||||
: (Type) beast_InterlockedDecrement64 ((volatile __int64*) &value);
|
||||
#elif BEAST_ATOMICS_GCC
|
||||
return (Type) __sync_add_and_fetch (&value, -1);
|
||||
return (Type) __sync_add_and_fetch (&value, (Type) -1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
#define BEAST_CHRONO_H_INCLUDED
|
||||
|
||||
#include "chrono/abstract_clock.h"
|
||||
#include "chrono/basic_seconds_clock.h"
|
||||
#include "chrono/chrono_io.h"
|
||||
#include "chrono/chrono_util.h"
|
||||
#include "chrono/manual_clock.h"
|
||||
#include "chrono/ratio_io.h"
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "insight/EventImpl.h"
|
||||
#include "insight/Gauge.h"
|
||||
#include "insight/GaugeImpl.h"
|
||||
#include "insight/Group.h"
|
||||
#include "insight/Groups.h"
|
||||
#include "insight/Hook.h"
|
||||
#include "insight/HookImpl.h"
|
||||
#include "insight/Collector.h"
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include "net/BufferType.h"
|
||||
#include "net/DynamicBuffer.h"
|
||||
|
||||
#include "net/IPAddress.h"
|
||||
#include "net/IPEndpoint.h"
|
||||
#include "net/IPAddressV4.h"
|
||||
#include "net/IPAddressV6.h"
|
||||
#include "net/IPEndpoint.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,5 @@
|
||||
#include "type_traits/IntegralConstant.h"
|
||||
#include "type_traits/IsIntegral.h"
|
||||
#include "type_traits/IsSigned.h"
|
||||
#include "type_traits/RemoveSigned.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
#ifndef BEAST_UTILITY_H_INCLUDED
|
||||
#define BEAST_UTILITY_H_INCLUDED
|
||||
|
||||
#include "utility/BaseFromMember.h"
|
||||
#include "utility/Debug.h"
|
||||
#include "utility/EnableIf.h"
|
||||
#include "utility/Error.h"
|
||||
#include "utility/Journal.h"
|
||||
#include "utility/LeakChecked.h"
|
||||
|
||||
@@ -20,3 +20,9 @@
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "impl/IPAddressConversion.cpp"
|
||||
|
||||
#include "tests/wrap_handler_tests.cpp"
|
||||
#include "tests/bind_handler_tests.cpp"
|
||||
#include "tests/shared_handler_tests.cpp"
|
||||
|
||||
#include "abstract_socket.cpp" // TEMPORARY!
|
||||
|
||||
@@ -20,41 +20,47 @@
|
||||
#ifndef BEAST_ASIO_IPADDRESSCONVERSION_H_INCLUDED
|
||||
#define BEAST_ASIO_IPADDRESSCONVERSION_H_INCLUDED
|
||||
|
||||
#include "../net/IPAddress.h"
|
||||
#include "../net/IPEndpoint.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
|
||||
namespace beast {
|
||||
namespace IP {
|
||||
|
||||
/** Convert to Endpoint.
|
||||
The port is set to zero.
|
||||
*/
|
||||
Endpoint from_asio (boost::asio::ip::address const& address);
|
||||
|
||||
/** Convert to Endpoint. */
|
||||
Endpoint from_asio (boost::asio::ip::tcp::endpoint const& endpoint);
|
||||
|
||||
/** Convert to asio::ip::address.
|
||||
The port is ignored.
|
||||
*/
|
||||
boost::asio::ip::address to_asio_address (Endpoint const& endpoint);
|
||||
|
||||
/** Convert to asio::ip::tcp::endpoint. */
|
||||
boost::asio::ip::tcp::endpoint to_asio_endpoint (Endpoint const& endpoint);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace beast {
|
||||
|
||||
// DEPRECATED
|
||||
struct IPAddressConversion
|
||||
{
|
||||
/** Convert to IPAddress.
|
||||
The port is set to zero.
|
||||
*/
|
||||
static IPAddress from_asio (boost::asio::ip::address const& address);
|
||||
|
||||
/** Convert to IPAddress, including port. */
|
||||
static IPAddress from_asio (boost::asio::ip::tcp::endpoint const& endpoint);
|
||||
|
||||
/** Convert to asio::ip::address.
|
||||
The port is ignored.
|
||||
*/
|
||||
static boost::asio::ip::address to_asio_address (IPAddress const& address);
|
||||
|
||||
/** Convert to asio::ip::tcp::endpoint. */
|
||||
static boost::asio::ip::tcp::endpoint to_asio_endpoint (IPAddress const& address);
|
||||
|
||||
/** Conversions to string. */
|
||||
/** @{ */
|
||||
static std::string to_string (boost::asio::ip::tcp::endpoint const& endpoint)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << endpoint;
|
||||
return ss.str();
|
||||
}
|
||||
/** @} */
|
||||
static IP::Endpoint from_asio (boost::asio::ip::address const& address)
|
||||
{ return IP::from_asio (address); }
|
||||
static IP::Endpoint from_asio (boost::asio::ip::tcp::endpoint const& endpoint)
|
||||
{ return IP::from_asio (endpoint); }
|
||||
static boost::asio::ip::address to_asio_address (IP::Endpoint const& address)
|
||||
{ return IP::to_asio_address (address); }
|
||||
static boost::asio::ip::tcp::endpoint to_asio_endpoint (IP::Endpoint const& address)
|
||||
{ return IP::to_asio_endpoint (address); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
217
src/beast/beast/asio/abstract_socket.cpp
Normal file
217
src/beast/beast/asio/abstract_socket.cpp
Normal file
@@ -0,0 +1,217 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "abstract_socket.h"
|
||||
#include "bind_handler.h"
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
#if ! BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// Socket
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void* abstract_socket::this_layer_ptr (char const*) const
|
||||
{
|
||||
pure_virtual_called ();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// native_handle
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
bool abstract_socket::native_handle (char const*, void*)
|
||||
{
|
||||
pure_virtual_called ();
|
||||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// basic_io_object
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
boost::asio::io_service& abstract_socket::get_io_service ()
|
||||
{
|
||||
pure_virtual_called ();
|
||||
return *static_cast <boost::asio::io_service*>(nullptr);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// basic_socket
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void*
|
||||
abstract_socket::lowest_layer_ptr (char const*) const
|
||||
{
|
||||
pure_virtual_called ();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto
|
||||
abstract_socket::cancel (boost::system::error_code& ec) -> error_code
|
||||
{
|
||||
return pure_virtual_error (ec);
|
||||
}
|
||||
|
||||
auto
|
||||
abstract_socket::shutdown (shutdown_type, boost::system::error_code& ec) -> error_code
|
||||
{
|
||||
return pure_virtual_error (ec);
|
||||
}
|
||||
|
||||
auto
|
||||
abstract_socket::close (boost::system::error_code& ec) -> error_code
|
||||
{
|
||||
return pure_virtual_error (ec);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// basic_socket_acceptor
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
auto
|
||||
abstract_socket::accept (abstract_socket&, error_code& ec) -> error_code
|
||||
{
|
||||
return pure_virtual_error (ec);
|
||||
}
|
||||
|
||||
void
|
||||
abstract_socket::async_accept (abstract_socket&, error_handler handler)
|
||||
{
|
||||
get_io_service ().post (bind_handler (
|
||||
handler, pure_virtual_error()));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// basic_stream_socket
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
std::size_t
|
||||
abstract_socket::read_some (mutable_buffers, error_code& ec)
|
||||
{
|
||||
ec = pure_virtual_error ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
abstract_socket::write_some (const_buffers, error_code& ec)
|
||||
{
|
||||
ec = pure_virtual_error ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
abstract_socket::async_read_some (mutable_buffers, transfer_handler handler)
|
||||
{
|
||||
get_io_service ().post (bind_handler (
|
||||
handler, pure_virtual_error(), 0));
|
||||
}
|
||||
|
||||
void
|
||||
abstract_socket::async_write_some (const_buffers, transfer_handler handler)
|
||||
{
|
||||
get_io_service ().post (bind_handler (
|
||||
handler, pure_virtual_error(), 0));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// ssl::stream
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void*
|
||||
abstract_socket::next_layer_ptr (char const*) const
|
||||
{
|
||||
pure_virtual_called ();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
abstract_socket::needs_handshake ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
abstract_socket::set_verify_mode (int)
|
||||
{
|
||||
pure_virtual_called ();
|
||||
}
|
||||
|
||||
auto
|
||||
abstract_socket::handshake (handshake_type, error_code& ec) -> error_code
|
||||
{
|
||||
return pure_virtual_error (ec);
|
||||
}
|
||||
|
||||
void
|
||||
abstract_socket::async_handshake (handshake_type, error_handler handler)
|
||||
{
|
||||
get_io_service ().post (bind_handler (
|
||||
handler, pure_virtual_error()));
|
||||
}
|
||||
|
||||
auto
|
||||
abstract_socket::handshake (handshake_type, const_buffers, error_code& ec) ->
|
||||
error_code
|
||||
{
|
||||
return pure_virtual_error (ec);
|
||||
}
|
||||
|
||||
void
|
||||
abstract_socket::async_handshake (handshake_type, const_buffers,
|
||||
transfer_handler handler)
|
||||
{
|
||||
get_io_service ().post (bind_handler (
|
||||
handler, pure_virtual_error(), 0));
|
||||
}
|
||||
|
||||
auto
|
||||
abstract_socket::shutdown (error_code& ec) -> error_code
|
||||
{
|
||||
return pure_virtual_error (ec);
|
||||
}
|
||||
|
||||
void
|
||||
abstract_socket::async_shutdown (error_handler handler)
|
||||
{
|
||||
get_io_service ().post (bind_handler (
|
||||
handler, pure_virtual_error()));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,28 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_ASIO_SOCKETS_SOCKET_H_INCLUDED
|
||||
#define BEAST_ASIO_SOCKETS_SOCKET_H_INCLUDED
|
||||
#ifndef BEAST_ASIO_ABSTRACT_SOCKET_H_INCLUDED
|
||||
#define BEAST_ASIO_ABSTRACT_SOCKET_H_INCLUDED
|
||||
|
||||
#include "buffer_sequence.h"
|
||||
#include "shared_handler.h"
|
||||
|
||||
#include <boost/asio/socket_base.hpp>
|
||||
#include <boost/asio/ssl/stream_base.hpp>
|
||||
|
||||
// Checking overrides replaces unimplemented stubs with pure virtuals
|
||||
#ifndef BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES
|
||||
# define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 1
|
||||
#endif
|
||||
|
||||
#if BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES
|
||||
# define BEAST_SOCKET_VIRTUAL = 0
|
||||
#else
|
||||
# define BEAST_SOCKET_VIRTUAL
|
||||
#endif
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
/** A high level socket abstraction.
|
||||
|
||||
@@ -29,18 +49,61 @@
|
||||
When member functions are called and the underlying implementation does
|
||||
not support the operation, a fatal error is generated.
|
||||
*/
|
||||
class Socket
|
||||
: public SocketBase
|
||||
, public boost::asio::ssl::stream_base
|
||||
class abstract_socket
|
||||
: public boost::asio::ssl::stream_base
|
||||
, public boost::asio::socket_base
|
||||
{
|
||||
protected:
|
||||
typedef boost::system::error_code error_code;
|
||||
|
||||
typedef asio::shared_handler <void (void)> post_handler;
|
||||
|
||||
typedef asio::shared_handler <void (error_code)> error_handler;
|
||||
|
||||
typedef asio::shared_handler <
|
||||
void (error_code, std::size_t)> transfer_handler;
|
||||
|
||||
static
|
||||
void
|
||||
pure_virtual_called()
|
||||
{
|
||||
throw std::runtime_error ("pure virtual called");
|
||||
}
|
||||
|
||||
static
|
||||
error_code
|
||||
pure_virtual_error ()
|
||||
{
|
||||
pure_virtual_called();
|
||||
return boost::system::errc::make_error_code (
|
||||
boost::system::errc::function_not_supported);
|
||||
}
|
||||
|
||||
static
|
||||
error_code
|
||||
pure_virtual_error (error_code& ec)
|
||||
{
|
||||
return ec = pure_virtual_error();
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
throw_if (error_code const& ec)
|
||||
{
|
||||
if (ec)
|
||||
throw boost::system::system_error (ec);
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~Socket ();
|
||||
virtual ~abstract_socket ()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
// Socket
|
||||
// abstract_socket
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/** Retrieve the underlying object.
|
||||
|
||||
@@ -48,32 +111,32 @@ public:
|
||||
exception is thrown if trying to acquire a reference.
|
||||
*/
|
||||
/** @{ */
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object& this_layer ()
|
||||
{
|
||||
Object* object (this->this_layer_ptr <Object> ());
|
||||
if (object == nullptr)
|
||||
Throw (std::bad_cast (), __FILE__, __LINE__);
|
||||
throw std::bad_cast ();
|
||||
return *object;
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object const& this_layer () const
|
||||
{
|
||||
Object const* object (this->this_layer_ptr <Object> ());
|
||||
if (object == nullptr)
|
||||
Throw (std::bad_cast (), __FILE__, __LINE__);
|
||||
throw std::bad_cast ();
|
||||
return *object;
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object* this_layer_ptr ()
|
||||
{
|
||||
return static_cast <Object*> (
|
||||
this->this_layer_ptr (typeid (Object).name ()));
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object const* this_layer_ptr () const
|
||||
{
|
||||
return static_cast <Object const*> (
|
||||
@@ -88,6 +151,7 @@ public:
|
||||
//
|
||||
// native_handle
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/** Retrieve the native representation of the object.
|
||||
|
||||
@@ -101,7 +165,7 @@ public:
|
||||
void native_handle (Handle* dest)
|
||||
{
|
||||
if (! native_handle (typeid (Handle).name (), dest))
|
||||
Throw (std::bad_cast (), __FILE__, __LINE__);
|
||||
throw std::bad_cast ();
|
||||
}
|
||||
|
||||
virtual bool native_handle (char const* type_name, void* dest)
|
||||
@@ -111,6 +175,7 @@ public:
|
||||
//
|
||||
// basic_io_object
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
virtual boost::asio::io_service& get_io_service ()
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
@@ -119,6 +184,7 @@ public:
|
||||
//
|
||||
// basic_socket
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/** Retrieve the lowest layer object.
|
||||
|
||||
@@ -126,32 +192,32 @@ public:
|
||||
exception is thrown if trying to acquire a reference.
|
||||
*/
|
||||
/** @{ */
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object& lowest_layer ()
|
||||
{
|
||||
Object* object (this->lowest_layer_ptr <Object> ());
|
||||
if (object == nullptr)
|
||||
Throw (std::bad_cast (), __FILE__, __LINE__);
|
||||
throw std::bad_cast ();
|
||||
return *object;
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object const& lowest_layer () const
|
||||
{
|
||||
Object const* object (this->lowest_layer_ptr <Object> ());
|
||||
if (object == nullptr)
|
||||
Throw (std::bad_cast (), __FILE__, __LINE__);
|
||||
throw std::bad_cast ();
|
||||
return *object;
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object* lowest_layer_ptr ()
|
||||
{
|
||||
return static_cast <Object*> (
|
||||
this->lowest_layer_ptr (typeid (Object).name ()));
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object const* lowest_layer_ptr () const
|
||||
{
|
||||
return static_cast <Object const*> (
|
||||
@@ -167,7 +233,8 @@ public:
|
||||
void cancel ()
|
||||
{
|
||||
error_code ec;
|
||||
throw_error (cancel (ec), __FILE__, __LINE__);
|
||||
cancel (ec);
|
||||
throw_if (ec);
|
||||
}
|
||||
|
||||
virtual error_code cancel (error_code& ec)
|
||||
@@ -176,7 +243,8 @@ public:
|
||||
void shutdown (shutdown_type what)
|
||||
{
|
||||
error_code ec;
|
||||
throw_error (shutdown (what, ec), __FILE__, __LINE__);
|
||||
shutdown (what, ec);
|
||||
throw_if (ec);
|
||||
}
|
||||
|
||||
virtual error_code shutdown (shutdown_type what,
|
||||
@@ -186,7 +254,8 @@ public:
|
||||
void close ()
|
||||
{
|
||||
error_code ec;
|
||||
throw_error (close (ec), __FILE__, __LINE__);
|
||||
close (ec);
|
||||
throw_if (ec);
|
||||
}
|
||||
|
||||
virtual error_code close (error_code& ec)
|
||||
@@ -196,82 +265,39 @@ public:
|
||||
//
|
||||
// basic_socket_acceptor
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
virtual error_code accept (Socket& peer, error_code& ec)
|
||||
virtual error_code accept (abstract_socket& peer, error_code& ec)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
template <typename AcceptHandler>
|
||||
void async_accept (Socket& peer, BOOST_ASIO_MOVE_ARG(AcceptHandler) handler)
|
||||
{
|
||||
return async_accept (peer,
|
||||
newAcceptHandler (BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)));
|
||||
}
|
||||
|
||||
virtual void async_accept (Socket& peer, SharedHandlerPtr handler)
|
||||
virtual void async_accept (abstract_socket& peer, error_handler handler)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
// basic_stream_socket
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
// SyncReadStream
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/SyncReadStream.html
|
||||
//
|
||||
template <typename MutableBufferSequence>
|
||||
std::size_t read_some (MutableBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
return read_some (MutableBuffers (buffers), ec);
|
||||
}
|
||||
|
||||
virtual std::size_t read_some (MutableBuffers const& buffers, error_code& ec)
|
||||
virtual std::size_t read_some (mutable_buffers buffers, error_code& ec)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
// SyncWriteStream
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/SyncWriteStream.html
|
||||
//
|
||||
template <typename ConstBufferSequence>
|
||||
std::size_t write_some (ConstBufferSequence const& buffers, error_code &ec)
|
||||
{
|
||||
return write_some (ConstBuffers (buffers), ec);
|
||||
}
|
||||
|
||||
virtual std::size_t write_some (ConstBuffers const& buffers, error_code& ec)
|
||||
virtual std::size_t write_some (const_buffers buffers, error_code& ec)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
// AsyncReadStream
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/AsyncReadStream.html
|
||||
//
|
||||
template <typename MutableBufferSequence, typename ReadHandler>
|
||||
void async_read_some (MutableBufferSequence const& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
|
||||
{
|
||||
return async_read_some (MutableBuffers (buffers),
|
||||
newReadHandler (BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)));
|
||||
}
|
||||
|
||||
virtual void async_read_some (MutableBuffers const& buffers, SharedHandlerPtr handler)
|
||||
virtual void async_read_some (mutable_buffers buffers,
|
||||
transfer_handler handler)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
// AsyncWriteStream
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/AsyncWriteStream.html
|
||||
//
|
||||
template <typename ConstBufferSequence, typename WriteHandler>
|
||||
void async_write_some (ConstBufferSequence const& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
|
||||
{
|
||||
return async_write_some (ConstBuffers (buffers),
|
||||
newWriteHandler (BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)));
|
||||
}
|
||||
|
||||
virtual void async_write_some (ConstBuffers const& buffers, SharedHandlerPtr handler)
|
||||
virtual void async_write_some (const_buffers buffers,
|
||||
transfer_handler handler)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
// ssl::stream
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/** Retrieve the next layer object.
|
||||
|
||||
@@ -279,32 +305,32 @@ public:
|
||||
exception is thrown if trying to acquire a reference.
|
||||
*/
|
||||
/** @{ */
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object& next_layer ()
|
||||
{
|
||||
Object* object (this->next_layer_ptr <Object> ());
|
||||
if (object == nullptr)
|
||||
Throw (std::bad_cast (), __FILE__, __LINE__);
|
||||
throw std::bad_cast ();
|
||||
return *object;
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object const& next_layer () const
|
||||
{
|
||||
Object const* object (this->next_layer_ptr <Object> ());
|
||||
if (object == nullptr)
|
||||
Throw (std::bad_cast (), __FILE__, __LINE__);
|
||||
throw std::bad_cast ();
|
||||
return *object;
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object* next_layer_ptr ()
|
||||
{
|
||||
return static_cast <Object*> (
|
||||
this->next_layer_ptr (typeid (Object).name ()));
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <class Object>
|
||||
Object const* next_layer_ptr () const
|
||||
{
|
||||
return static_cast <Object const*> (
|
||||
@@ -330,107 +356,49 @@ public:
|
||||
virtual bool needs_handshake ()
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__verify_mode.html
|
||||
//
|
||||
virtual void set_verify_mode (int verify_mode) = 0;
|
||||
virtual void set_verify_mode (int verify_mode)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
// ssl::stream::handshake (1 of 4)
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload1.html
|
||||
//
|
||||
void handshake (handshake_type type)
|
||||
{
|
||||
error_code ec;
|
||||
throw_error (handshake (type, ec), __FILE__, __LINE__);
|
||||
handshake (type, ec);
|
||||
throw_if (ec);
|
||||
}
|
||||
|
||||
// ssl::stream::handshake (2 of 4)
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload2.html
|
||||
//
|
||||
virtual error_code handshake (handshake_type type, error_code& ec)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
// ssl::stream::async_handshake (1 of 2)
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_handshake/overload1.html
|
||||
//
|
||||
template <typename HandshakeHandler>
|
||||
void async_handshake (handshake_type type, BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler)
|
||||
{
|
||||
return async_handshake (type,
|
||||
newHandshakeHandler (BOOST_ASIO_MOVE_CAST(HandshakeHandler)(handler)));
|
||||
}
|
||||
|
||||
virtual void async_handshake (handshake_type type, SharedHandlerPtr handler)
|
||||
virtual void async_handshake (handshake_type type, error_handler handler)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
#if BEAST_ASIO_HAS_BUFFEREDHANDSHAKE
|
||||
// ssl::stream::handshake (3 of 4)
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload3.html
|
||||
//
|
||||
template <typename ConstBufferSequence>
|
||||
void handshake (handshake_type type, ConstBufferSequence const& buffers)
|
||||
{
|
||||
error_code ec;
|
||||
throw_error (handshake (type, buffers, ec), __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
// ssl::stream::handshake (4 of 4)
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload4.html
|
||||
//
|
||||
template <typename ConstBufferSequence>
|
||||
error_code handshake (handshake_type type,
|
||||
ConstBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
return handshake (type, ConstBuffers (buffers), ec);
|
||||
}
|
||||
|
||||
virtual error_code handshake (handshake_type type,
|
||||
ConstBuffers const& buffers, error_code& ec)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
const_buffers buffers, error_code& ec)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
// ssl::stream::async_handshake (2 of 2)
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_handshake/overload2.html
|
||||
//
|
||||
template <typename ConstBufferSequence, typename BufferedHandshakeHandler>
|
||||
void async_handshake (handshake_type type, ConstBufferSequence const& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(BufferedHandshakeHandler) handler)
|
||||
{
|
||||
return async_handshake (type, ConstBuffers (buffers),
|
||||
newBufferedHandshakeHandler (BOOST_ASIO_MOVE_CAST(BufferedHandshakeHandler)(handler)));
|
||||
}
|
||||
|
||||
virtual void async_handshake (handshake_type type, ConstBuffers const& buffers,
|
||||
SharedHandlerPtr handler)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
#endif
|
||||
virtual void async_handshake (handshake_type type,
|
||||
const_buffers buffers, transfer_handler handler)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
// ssl::stream::shutdown
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/shutdown.html
|
||||
//
|
||||
void shutdown ()
|
||||
{
|
||||
error_code ec;
|
||||
throw_error (shutdown (ec), __FILE__, __LINE__);
|
||||
shutdown (ec);
|
||||
throw_if (ec);
|
||||
}
|
||||
|
||||
virtual error_code shutdown (error_code& ec)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
|
||||
// ssl::stream::async_shutdown
|
||||
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_shutdown.html
|
||||
//
|
||||
template <typename ShutdownHandler>
|
||||
void async_shutdown (BOOST_ASIO_MOVE_ARG(ShutdownHandler) handler)
|
||||
{
|
||||
return async_shutdown (
|
||||
newShutdownHandler (BOOST_ASIO_MOVE_CAST(ShutdownHandler)(handler)));
|
||||
}
|
||||
|
||||
virtual void async_shutdown (SharedHandlerPtr handler)
|
||||
virtual void async_shutdown (error_handler handler)
|
||||
BEAST_SOCKET_VIRTUAL;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
163
src/beast/beast/asio/bind_handler.h
Normal file
163
src/beast/beast/asio/bind_handler.h
Normal file
@@ -0,0 +1,163 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_ASIO_BIND_HANDLER_H_INCLUDED
|
||||
#define BEAST_ASIO_BIND_HANDLER_H_INCLUDED
|
||||
|
||||
#include <boost/asio/detail/handler_alloc_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_cont_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_invoke_helpers.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include "../cxx14/type_traits.h" // <type_traits>
|
||||
#include "../cxx14/utility.h" // <utility>
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
namespace detail {
|
||||
|
||||
/** Nullary handler that calls Handler with bound arguments.
|
||||
The rebound handler provides the same io_service execution
|
||||
guarantees as the original handler.
|
||||
*/
|
||||
template <class DeducedHandler, class... Args>
|
||||
class bound_handler
|
||||
{
|
||||
private:
|
||||
typedef std::tuple <std::decay_t <Args>...> args_type;
|
||||
|
||||
std::decay_t <DeducedHandler> m_handler;
|
||||
args_type m_args;
|
||||
|
||||
template <class Handler, class Tuple, std::size_t... S>
|
||||
static void invoke (Handler& h, Tuple& args,
|
||||
std::index_sequence <S...>)
|
||||
{
|
||||
h (std::get <S> (args)...);
|
||||
}
|
||||
|
||||
public:
|
||||
typedef void result_type;
|
||||
|
||||
bound_handler (DeducedHandler&& handler, Args&&... args)
|
||||
: m_handler (std::forward <DeducedHandler> (handler))
|
||||
, m_args (std::forward <Args> (args)...)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
operator() ()
|
||||
{
|
||||
invoke (m_handler, m_args,
|
||||
std::index_sequence_for <Args...> ());
|
||||
}
|
||||
|
||||
void
|
||||
operator() () const
|
||||
{
|
||||
invoke (m_handler, m_args,
|
||||
std::index_sequence_for <Args...> ());
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend
|
||||
void
|
||||
asio_handler_invoke (Function& f, bound_handler* h)
|
||||
{
|
||||
boost_asio_handler_invoke_helpers::
|
||||
invoke (f, h->m_handler);
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend
|
||||
void
|
||||
asio_handler_invoke (Function const& f, bound_handler* h)
|
||||
{
|
||||
boost_asio_handler_invoke_helpers::
|
||||
invoke (f, h->m_handler);
|
||||
}
|
||||
|
||||
friend
|
||||
void*
|
||||
asio_handler_allocate (std::size_t size, bound_handler* h)
|
||||
{
|
||||
return boost_asio_handler_alloc_helpers::
|
||||
allocate (size, h->m_handler);
|
||||
}
|
||||
|
||||
friend
|
||||
void
|
||||
asio_handler_deallocate (void* p, std::size_t size, bound_handler* h)
|
||||
{
|
||||
boost_asio_handler_alloc_helpers::
|
||||
deallocate (p, size, h->m_handler);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation (bound_handler* h)
|
||||
{
|
||||
return boost_asio_handler_cont_helpers::
|
||||
is_continuation (h->m_handler);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Binds parameters to a handler to produce a nullary functor.
|
||||
The returned handler provides the same io_service execution guarantees
|
||||
as the original handler. This is designed to use as a replacement for
|
||||
io_service::wrap, to ensure that the handler will not be invoked
|
||||
immediately by the calling function.
|
||||
*/
|
||||
template <class DeducedHandler, class... Args>
|
||||
detail::bound_handler <DeducedHandler, Args...>
|
||||
bind_handler (DeducedHandler&& handler, Args&&... args)
|
||||
{
|
||||
return detail::bound_handler <DeducedHandler, Args...> (
|
||||
std::forward <DeducedHandler> (handler),
|
||||
std::forward <Args> (args)...);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace std {
|
||||
|
||||
template <class Handler, class... Args>
|
||||
void bind (beast::asio::detail::bound_handler <
|
||||
Handler, Args...>, ...) = delete;
|
||||
|
||||
#if 0
|
||||
template <class Handler, class... Args>
|
||||
struct is_bind_expression <
|
||||
beast::asio::detail::bound_handler <Handler, Args...>
|
||||
> : std::true_type
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
110
src/beast/beast/asio/buffer_sequence.h
Normal file
110
src/beast/beast/asio/buffer_sequence.h
Normal file
@@ -0,0 +1,110 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_ASIO_BUFFER_SEQUENCE_H_INCLUDED
|
||||
#define BEAST_ASIO_BUFFER_SEQUENCE_H_INCLUDED
|
||||
|
||||
#include <boost/asio/buffer.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include "../cxx14/type_traits.h" // <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
template <class Buffer>
|
||||
class buffer_sequence
|
||||
{
|
||||
private:
|
||||
typedef std::vector <Buffer> sequence_type;
|
||||
|
||||
public:
|
||||
typedef Buffer value_type;
|
||||
typedef typename sequence_type::const_iterator const_iterator;
|
||||
|
||||
private:
|
||||
sequence_type m_buffers;
|
||||
|
||||
template <class FwdIter>
|
||||
void assign (FwdIter first, FwdIter last)
|
||||
{
|
||||
m_buffers.clear();
|
||||
m_buffers.reserve (std::distance (first, last));
|
||||
for (;first != last; ++first)
|
||||
m_buffers.push_back (*first);
|
||||
}
|
||||
|
||||
public:
|
||||
buffer_sequence ()
|
||||
{
|
||||
}
|
||||
|
||||
template <
|
||||
class BufferSequence,
|
||||
class = std::enable_if_t <std::is_constructible <
|
||||
Buffer, typename BufferSequence::value_type>::value>
|
||||
>
|
||||
buffer_sequence (BufferSequence const& s)
|
||||
{
|
||||
assign (std::begin (s), std::end (s));
|
||||
}
|
||||
|
||||
template <
|
||||
class FwdIter,
|
||||
class = std::enable_if_t <std::is_constructible <
|
||||
Buffer, typename std::iterator_traits <
|
||||
FwdIter>::value_type>::value>
|
||||
>
|
||||
buffer_sequence (FwdIter first, FwdIter last)
|
||||
{
|
||||
assign (first, last);
|
||||
}
|
||||
|
||||
template <class BufferSequence>
|
||||
std::enable_if_t <std::is_constructible <
|
||||
Buffer, typename BufferSequence::value_type>::value,
|
||||
buffer_sequence&
|
||||
>
|
||||
operator= (BufferSequence const& s)
|
||||
{
|
||||
return assign (s);
|
||||
}
|
||||
|
||||
const_iterator
|
||||
begin () const noexcept
|
||||
{
|
||||
return m_buffers.begin ();
|
||||
}
|
||||
|
||||
const_iterator
|
||||
end () const noexcept
|
||||
{
|
||||
return m_buffers.end ();
|
||||
}
|
||||
};
|
||||
|
||||
typedef buffer_sequence <boost::asio::const_buffer> const_buffers;
|
||||
typedef buffer_sequence <boost::asio::mutable_buffer> mutable_buffers;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -20,34 +20,35 @@
|
||||
#include "../IPAddressConversion.h"
|
||||
|
||||
namespace beast {
|
||||
namespace IP {
|
||||
|
||||
IPAddress IPAddressConversion::from_asio (boost::asio::ip::address const& address)
|
||||
Endpoint from_asio (boost::asio::ip::address const& address)
|
||||
{
|
||||
if (address.is_v4 ())
|
||||
{
|
||||
boost::asio::ip::address_v4::bytes_type const bytes (
|
||||
address.to_v4().to_bytes());
|
||||
return IPAddress (IPAddress::V4 (
|
||||
return Endpoint (AddressV4 (
|
||||
bytes [0], bytes [1], bytes [2], bytes [3]));
|
||||
}
|
||||
|
||||
// VFALCO TODO IPv6 support
|
||||
bassertfalse;
|
||||
return IPAddress();
|
||||
return Endpoint();
|
||||
}
|
||||
|
||||
IPAddress IPAddressConversion::from_asio (boost::asio::ip::tcp::endpoint const& endpoint)
|
||||
Endpoint from_asio (boost::asio::ip::tcp::endpoint const& endpoint)
|
||||
{
|
||||
return from_asio (endpoint.address()).withPort (endpoint.port());
|
||||
return from_asio (endpoint.address()).at_port (endpoint.port());
|
||||
}
|
||||
|
||||
boost::asio::ip::address IPAddressConversion::to_asio_address (IPAddress const& address)
|
||||
boost::asio::ip::address to_asio_address (Endpoint const& endpoint)
|
||||
{
|
||||
if (address.isV4 ())
|
||||
if (endpoint.address().is_v4())
|
||||
{
|
||||
return boost::asio::ip::address (
|
||||
boost::asio::ip::address_v4 (
|
||||
address.v4().value));
|
||||
endpoint.address().to_v4().value));
|
||||
}
|
||||
|
||||
// VFALCO TODO IPv6 support
|
||||
@@ -56,10 +57,11 @@ boost::asio::ip::address IPAddressConversion::to_asio_address (IPAddress const&
|
||||
boost::asio::ip::address_v6 ());
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::endpoint IPAddressConversion::to_asio_endpoint (IPAddress const& address)
|
||||
boost::asio::ip::tcp::endpoint to_asio_endpoint (Endpoint const& endpoint)
|
||||
{
|
||||
return boost::asio::ip::tcp::endpoint (
|
||||
to_asio_address (address), address.port());
|
||||
to_asio_address (endpoint), endpoint.port());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
245
src/beast/beast/asio/io_latency_probe.h
Normal file
245
src/beast/beast/asio/io_latency_probe.h
Normal file
@@ -0,0 +1,245 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED
|
||||
#define BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED
|
||||
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <boost/asio/deadline_timer.hpp>
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace beast {
|
||||
|
||||
/** Measures handler latency on an io_service queue. */
|
||||
template <class Clock>
|
||||
class io_latency_probe
|
||||
{
|
||||
private:
|
||||
typedef typename Clock::duration duration;
|
||||
typedef typename Clock::time_point time_point;
|
||||
|
||||
std::recursive_mutex m_mutex;
|
||||
std::condition_variable_any m_cond;
|
||||
std::size_t m_count;
|
||||
duration const m_period;
|
||||
boost::asio::io_service& m_ios;
|
||||
boost::asio::deadline_timer m_timer;
|
||||
bool m_cancel;
|
||||
|
||||
public:
|
||||
io_latency_probe (duration const& period,
|
||||
boost::asio::io_service& ios)
|
||||
: m_count (1)
|
||||
, m_period (period)
|
||||
, m_ios (ios)
|
||||
, m_timer (m_ios)
|
||||
, m_cancel (false)
|
||||
{
|
||||
}
|
||||
|
||||
~io_latency_probe ()
|
||||
{
|
||||
std::unique_lock <decltype (m_mutex)> lock (m_mutex);
|
||||
cancel (lock, true);
|
||||
}
|
||||
|
||||
/** Return the io_service associated with the latency probe. */
|
||||
/** @{ */
|
||||
boost::asio::io_service& get_io_service ()
|
||||
{
|
||||
return m_ios;
|
||||
}
|
||||
|
||||
boost::asio::io_service const& get_io_service () const
|
||||
{
|
||||
return m_ios;
|
||||
}
|
||||
/** @} */
|
||||
|
||||
/** Cancel all pending i/o.
|
||||
Any handlers which have already been queued will still be called.
|
||||
*/
|
||||
/** @{ */
|
||||
void cancel ()
|
||||
{
|
||||
std::unique_lock <decltype(m_mutex)> lock (m_mutex);
|
||||
cancel (lock, true);
|
||||
}
|
||||
|
||||
void cancel_async ()
|
||||
{
|
||||
std::unique_lock <decltype(m_mutex)> lock (m_mutex);
|
||||
cancel (lock, false);
|
||||
}
|
||||
/** @} */
|
||||
|
||||
/** Measure one sample of i/o latency.
|
||||
Handler will be called with this signature:
|
||||
void Handler (Duration d);
|
||||
*/
|
||||
template <class Handler>
|
||||
void sample_one (Handler&& handler)
|
||||
{
|
||||
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
|
||||
if (m_cancel)
|
||||
throw std::logic_error ("io_latency_probe is canceled");
|
||||
m_ios.post (sample_op <Handler> (
|
||||
std::forward <Handler> (handler),
|
||||
Clock::now(), false, this));
|
||||
}
|
||||
|
||||
/** Initiate continuous i/o latency sampling.
|
||||
Handler will be called with this signature:
|
||||
void Handler (std::chrono::milliseconds);
|
||||
*/
|
||||
template <class Handler>
|
||||
void sample (Handler&& handler)
|
||||
{
|
||||
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
|
||||
if (m_cancel)
|
||||
throw std::logic_error ("io_latency_probe is canceled");
|
||||
m_ios.post (sample_op <Handler> (
|
||||
std::forward <Handler> (handler),
|
||||
Clock::now(), true, this));
|
||||
}
|
||||
|
||||
private:
|
||||
void cancel (std::unique_lock <decltype (m_mutex)>& lock,
|
||||
bool wait)
|
||||
{
|
||||
if (! m_cancel)
|
||||
{
|
||||
--m_count;
|
||||
m_cancel = true;
|
||||
}
|
||||
|
||||
if (wait)
|
||||
#ifdef BOOST_NO_CXX11_LAMBDAS
|
||||
while (m_count != 0)
|
||||
m_cond.wait (lock);
|
||||
#else
|
||||
m_cond.wait (lock, [this] {
|
||||
return this->m_count == 0; });
|
||||
#endif
|
||||
}
|
||||
|
||||
void addref ()
|
||||
{
|
||||
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
|
||||
++m_count;
|
||||
}
|
||||
|
||||
void release ()
|
||||
{
|
||||
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
|
||||
if (--m_count == 0)
|
||||
m_cond.notify_all ();
|
||||
}
|
||||
|
||||
template <class Handler>
|
||||
struct sample_op
|
||||
{
|
||||
Handler m_handler;
|
||||
time_point m_start;
|
||||
bool m_repeat;
|
||||
io_latency_probe* m_probe;
|
||||
|
||||
sample_op (Handler const& handler, time_point const& start,
|
||||
bool repeat, io_latency_probe* probe)
|
||||
: m_handler (handler)
|
||||
, m_start (start)
|
||||
, m_repeat (repeat)
|
||||
, m_probe (probe)
|
||||
{
|
||||
m_probe->addref();
|
||||
}
|
||||
|
||||
sample_op (sample_op const& other)
|
||||
: m_handler (other.m_handler)
|
||||
, m_start (other.m_start)
|
||||
, m_probe (other.m_probe)
|
||||
{
|
||||
m_probe->addref();
|
||||
}
|
||||
|
||||
~sample_op ()
|
||||
{
|
||||
m_probe->release();
|
||||
}
|
||||
|
||||
void operator() () const
|
||||
{
|
||||
typename Clock::time_point const now (Clock::now());
|
||||
typename Clock::duration const elapsed (now - m_start);
|
||||
|
||||
m_handler (elapsed);
|
||||
|
||||
{
|
||||
std::lock_guard <decltype (m_probe->m_mutex)
|
||||
> lock (m_probe->m_mutex);
|
||||
if (m_probe->m_cancel)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_repeat)
|
||||
{
|
||||
// Calculate when we want to sample again, and
|
||||
// adjust for the expected latency.
|
||||
//
|
||||
typename Clock::time_point const when (
|
||||
now + m_probe->m_period - 2 * elapsed);
|
||||
|
||||
if (when <= now)
|
||||
{
|
||||
// The latency is too high to maintain the desired
|
||||
// period so don't bother with a timer.
|
||||
//
|
||||
m_probe->m_ios.post (sample_op <Handler> (
|
||||
m_handler, now, m_repeat, m_probe));
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::posix_time::microseconds mms (
|
||||
std::chrono::duration_cast <
|
||||
std::chrono::microseconds> (
|
||||
when - now).count ());
|
||||
m_probe->m_timer.expires_from_now (mms);
|
||||
m_probe->m_timer.async_wait (sample_op <Handler> (
|
||||
m_handler, now, m_repeat, m_probe));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void operator () (boost::system::error_code const& ec)
|
||||
{
|
||||
typename Clock::time_point const now (Clock::now());
|
||||
m_probe->m_ios.post (sample_op <Handler> (
|
||||
m_handler, now, m_repeat, m_probe));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
41
src/beast/beast/asio/placeholders.h
Normal file
41
src/beast/beast/asio/placeholders.h
Normal file
@@ -0,0 +1,41 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_ASIO_PLACEHOLDERS_H_INCLUDED
|
||||
#define BEAST_ASIO_PLACEHOLDERS_H_INCLUDED
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
namespace placeholders {
|
||||
// asio placeholders that work with std::bind
|
||||
namespace {
|
||||
static auto const error (std::placeholders::_1);
|
||||
static auto const bytes_transferred (std::placeholders::_2);
|
||||
static auto const iterator (std::placeholders::_2);
|
||||
static auto const signal_number (std::placeholders::_2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
472
src/beast/beast/asio/shared_handler.h
Normal file
472
src/beast/beast/asio/shared_handler.h
Normal file
@@ -0,0 +1,472 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_ASIO_SHARED_HANDLER_H_INCLUDED
|
||||
#define BEAST_ASIO_SHARED_HANDLER_H_INCLUDED
|
||||
|
||||
#include "../mpl/IsCallPossible.h"
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include "../cxx14/type_traits.h" // <type_traits>
|
||||
|
||||
#include <boost/utility/base_from_member.hpp>
|
||||
|
||||
#include <boost/asio/detail/handler_alloc_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_cont_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_invoke_helpers.hpp>
|
||||
|
||||
#ifndef BEAST_ASIO_NO_ALLOCATE_SHARED
|
||||
#define BEAST_ASIO_NO_ALLOCATE_SHARED 0
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_ASIO_NO_HANDLER_RESULT_OF
|
||||
#define BEAST_ASIO_NO_HANDLER_RESULT_OF 1
|
||||
#endif
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
class shared_handler_wrapper_base
|
||||
{
|
||||
public:
|
||||
virtual ~shared_handler_wrapper_base()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void invoke (std::function <void (void)> f) = 0;
|
||||
virtual void* allocate (std::size_t size) = 0;
|
||||
virtual void deallocate (void* p, std::size_t size) = 0;
|
||||
virtual bool is_continuation () = 0;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <class Signature>
|
||||
class shared_handler_wrapper_func
|
||||
: public shared_handler_wrapper_base
|
||||
{
|
||||
private:
|
||||
std::function <Signature> m_func;
|
||||
|
||||
public:
|
||||
template <class Handler>
|
||||
explicit shared_handler_wrapper_func (Handler&& handler)
|
||||
: m_func (std::ref (std::forward <Handler> (handler)))
|
||||
{
|
||||
}
|
||||
|
||||
template <class... Args>
|
||||
#if BEAST_ASIO_NO_HANDLER_RESULT_OF
|
||||
void
|
||||
#else
|
||||
std::result_of_t <std::function <Signature> (Args...)>
|
||||
#endif
|
||||
operator() (Args&&... args) const
|
||||
{
|
||||
return m_func (std::forward <Args> (args)...);
|
||||
}
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace detail {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4512) // assignment operator could not be generated
|
||||
#endif
|
||||
|
||||
template <class Signature, class Handler>
|
||||
class shared_handler_wrapper
|
||||
: private boost::base_from_member <Handler>
|
||||
, public shared_handler_wrapper_func <Signature>
|
||||
{
|
||||
private:
|
||||
typedef boost::base_from_member <Handler> Base;
|
||||
|
||||
BEAST_DEFINE_IS_CALL_POSSIBLE(has_is_continuation, is_continuation);
|
||||
|
||||
public:
|
||||
shared_handler_wrapper (Handler&& handler)
|
||||
: boost::base_from_member <Handler> (std::move (handler))
|
||||
, shared_handler_wrapper_func <Signature> (Base::member)
|
||||
{
|
||||
}
|
||||
|
||||
shared_handler_wrapper (Handler const& handler)
|
||||
: boost::base_from_member <Handler> (handler)
|
||||
, shared_handler_wrapper_func <Signature> (Base::member)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
void
|
||||
invoke (std::function <void (void)> f) override
|
||||
{
|
||||
return boost_asio_handler_invoke_helpers::
|
||||
invoke (f, Base::member);
|
||||
}
|
||||
|
||||
void*
|
||||
allocate (std::size_t size) override
|
||||
{
|
||||
return boost_asio_handler_alloc_helpers::
|
||||
allocate (size, Base::member);
|
||||
}
|
||||
|
||||
void
|
||||
deallocate (void* p, std::size_t size) override
|
||||
{
|
||||
boost_asio_handler_alloc_helpers::
|
||||
deallocate (p, size, Base::member);
|
||||
}
|
||||
|
||||
bool
|
||||
is_continuation () override
|
||||
{
|
||||
return is_continuation (std::integral_constant <bool,
|
||||
has_is_continuation <Handler, bool(void)>::value>());
|
||||
}
|
||||
|
||||
bool
|
||||
is_continuation (std::true_type)
|
||||
{
|
||||
return Base::member.is_continuation();
|
||||
}
|
||||
|
||||
bool
|
||||
is_continuation (std::false_type)
|
||||
{
|
||||
return boost_asio_handler_cont_helpers::
|
||||
is_continuation (Base::member);
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
struct is_shared_handler : public std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <class T, class Handler>
|
||||
class handler_allocator
|
||||
{
|
||||
private:
|
||||
// We want a partial template specialization as a friend
|
||||
// but that isn't allowed so we friend all versions. This
|
||||
// should produce a compile error if Handler is not constructible
|
||||
// from H.
|
||||
//
|
||||
template <class U, class H>
|
||||
friend class handler_allocator;
|
||||
|
||||
Handler m_handler;
|
||||
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
|
||||
template <class U>
|
||||
struct rebind
|
||||
{
|
||||
public:
|
||||
typedef handler_allocator <U, Handler> other;
|
||||
};
|
||||
|
||||
handler_allocator() = delete;
|
||||
|
||||
handler_allocator (Handler const& handler)
|
||||
: m_handler (handler)
|
||||
{
|
||||
}
|
||||
|
||||
template <class U>
|
||||
handler_allocator (
|
||||
handler_allocator <U, Handler> const& other)
|
||||
: m_handler (other.m_handler)
|
||||
{
|
||||
}
|
||||
|
||||
handler_allocator&
|
||||
operator= (handler_allocator const&) = delete;
|
||||
|
||||
pointer
|
||||
allocate (std::ptrdiff_t n)
|
||||
{
|
||||
auto const size (n * sizeof (T));
|
||||
return static_cast <pointer> (
|
||||
boost_asio_handler_alloc_helpers::allocate (
|
||||
size, m_handler));
|
||||
}
|
||||
|
||||
void
|
||||
deallocate (pointer p, std::ptrdiff_t n)
|
||||
{
|
||||
auto const size (n * sizeof (T));
|
||||
boost_asio_handler_alloc_helpers::deallocate (
|
||||
p, size, m_handler);
|
||||
}
|
||||
|
||||
// Work-around for MSVC not using allocator_traits
|
||||
// in the implementation of shared_ptr
|
||||
//
|
||||
#ifdef _MSC_VER
|
||||
void
|
||||
destroy (T* t)
|
||||
{
|
||||
t->~T();
|
||||
}
|
||||
#endif
|
||||
|
||||
friend
|
||||
bool
|
||||
operator== (handler_allocator const& lhs, handler_allocator const& rhs)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator!= (handler_allocator const& lhs, handler_allocator const& rhs)
|
||||
{
|
||||
return ! (lhs == rhs);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Handler shared reference that provides io_service execution guarantees. */
|
||||
template <
|
||||
class Signature
|
||||
>
|
||||
class shared_handler
|
||||
{
|
||||
private:
|
||||
template <class T>
|
||||
friend class shared_handler_allocator;
|
||||
|
||||
typedef shared_handler_wrapper_func <
|
||||
Signature> wrapper_type;
|
||||
|
||||
typedef std::shared_ptr <wrapper_type> ptr_type;
|
||||
|
||||
ptr_type m_ptr;
|
||||
|
||||
public:
|
||||
shared_handler()
|
||||
{
|
||||
}
|
||||
|
||||
template <
|
||||
class DeducedHandler,
|
||||
class = std::enable_if_t <
|
||||
! detail::is_shared_handler <
|
||||
std::decay_t <DeducedHandler>>::value &&
|
||||
std::is_constructible <std::function <Signature>,
|
||||
std::decay_t <DeducedHandler>>::value
|
||||
>
|
||||
>
|
||||
shared_handler (DeducedHandler&& handler)
|
||||
{
|
||||
typedef std::remove_reference_t <DeducedHandler> Handler;
|
||||
|
||||
#if BEAST_ASIO_NO_ALLOCATE_SHARED
|
||||
m_ptr = std::make_shared <detail::shared_handler_wrapper <
|
||||
Signature, Handler>> (std::forward <DeducedHandler> (handler));
|
||||
#else
|
||||
m_ptr = std::allocate_shared <detail::shared_handler_wrapper <
|
||||
Signature, Handler>> (detail::handler_allocator <char, Handler> (
|
||||
handler), std::forward <DeducedHandler> (handler));
|
||||
#endif
|
||||
}
|
||||
|
||||
shared_handler (shared_handler&& other)
|
||||
: m_ptr (std::move (other.m_ptr))
|
||||
{
|
||||
}
|
||||
|
||||
shared_handler (shared_handler const& other)
|
||||
: m_ptr (other.m_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
shared_handler&
|
||||
operator= (std::nullptr_t)
|
||||
{
|
||||
m_ptr = nullptr;
|
||||
}
|
||||
|
||||
shared_handler&
|
||||
operator= (shared_handler const& rhs)
|
||||
{
|
||||
m_ptr = rhs.m_ptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool
|
||||
empty() const
|
||||
{
|
||||
return ! m_ptr.operator bool();
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return !empty();
|
||||
}
|
||||
|
||||
void
|
||||
reset()
|
||||
{
|
||||
m_ptr.reset();
|
||||
}
|
||||
|
||||
template <class... Args>
|
||||
#if BEAST_ASIO_NO_HANDLER_RESULT_OF
|
||||
void
|
||||
#else
|
||||
std::result_of_t <std::function <Signature> (Args...)>
|
||||
#endif
|
||||
operator() (Args&&... args) const
|
||||
{
|
||||
return (*m_ptr)(std::forward <Args> (args)...);
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend
|
||||
void
|
||||
asio_handler_invoke (Function&& f, shared_handler* h)
|
||||
{
|
||||
return h->m_ptr->invoke (f);
|
||||
}
|
||||
|
||||
friend
|
||||
void*
|
||||
asio_handler_allocate (
|
||||
std::size_t size, shared_handler* h)
|
||||
{
|
||||
return h->m_ptr->allocate (size);
|
||||
}
|
||||
|
||||
friend
|
||||
void
|
||||
asio_handler_deallocate (
|
||||
void* p, std::size_t size, shared_handler* h)
|
||||
{
|
||||
return h->m_ptr->deallocate (p, size);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation (
|
||||
shared_handler* h)
|
||||
{
|
||||
return h->m_ptr->is_continuation ();
|
||||
}
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <
|
||||
class Signature
|
||||
>
|
||||
struct is_shared_handler <
|
||||
shared_handler <Signature>
|
||||
> : public std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <class T>
|
||||
class shared_handler_allocator
|
||||
{
|
||||
private:
|
||||
template <class U>
|
||||
friend class shared_handler_allocator;
|
||||
|
||||
std::shared_ptr <shared_handler_wrapper_base> m_ptr;
|
||||
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
|
||||
shared_handler_allocator() = delete;
|
||||
|
||||
template <class Signature>
|
||||
shared_handler_allocator (
|
||||
shared_handler <Signature> const& handler)
|
||||
: m_ptr (handler.m_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
template <class U>
|
||||
shared_handler_allocator (
|
||||
shared_handler_allocator <U> const& other)
|
||||
: m_ptr (other.m_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
pointer
|
||||
allocate (std::ptrdiff_t n)
|
||||
{
|
||||
auto const size (n * sizeof (T));
|
||||
return static_cast <pointer> (
|
||||
m_ptr->allocate (size));
|
||||
}
|
||||
|
||||
void
|
||||
deallocate (pointer p, std::ptrdiff_t n)
|
||||
{
|
||||
auto const size (n * sizeof (T));
|
||||
m_ptr->deallocate (p, size);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator== (shared_handler_allocator const& lhs,
|
||||
shared_handler_allocator const& rhs)
|
||||
{
|
||||
return lhs.m_ptr == rhs.m_ptr;
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator!= (shared_handler_allocator const& lhs,
|
||||
shared_handler_allocator const& rhs)
|
||||
{
|
||||
return ! (lhs == rhs);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
58
src/beast/beast/asio/tests/bind_handler_tests.cpp
Normal file
58
src/beast/beast/asio/tests/bind_handler_tests.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
||||
|
||||
#include "../bind_handler.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
class bind_handler_Tests : public UnitTest
|
||||
{
|
||||
public:
|
||||
static void foo (int)
|
||||
{
|
||||
}
|
||||
|
||||
void runTest()
|
||||
{
|
||||
beginTestCase ("call");
|
||||
|
||||
auto f (bind_handler (std::bind (&foo, std::placeholders::_1),
|
||||
42));
|
||||
|
||||
f();
|
||||
|
||||
pass();
|
||||
}
|
||||
|
||||
bind_handler_Tests() : UnitTest ("bind_handler", "beast", runManual)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static bind_handler_Tests bind_handler_tests;
|
||||
|
||||
}
|
||||
}
|
||||
239
src/beast/beast/asio/tests/shared_handler_tests.cpp
Normal file
239
src/beast/beast/asio/tests/shared_handler_tests.cpp
Normal file
@@ -0,0 +1,239 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
||||
|
||||
#include "../shared_handler.h"
|
||||
|
||||
// Disables is_constructible tests for std::function
|
||||
// Visual Studio std::function fails the is_constructible tests
|
||||
#ifndef BEAST_NO_STD_FUNCTION_CONSTRUCTIBLE
|
||||
# ifdef _MSC_VER
|
||||
# define BEAST_NO_STD_FUNCTION_CONSTRUCTIBLE 1
|
||||
# else
|
||||
# define BEAST_NO_STD_FUNCTION_CONSTRUCTIBLE 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace beast {
|
||||
|
||||
class shared_handler_Tests : public UnitTest
|
||||
{
|
||||
public:
|
||||
struct test_results
|
||||
{
|
||||
bool call;
|
||||
bool invoke;
|
||||
bool alloc;
|
||||
bool dealloc;
|
||||
bool cont;
|
||||
|
||||
test_results ()
|
||||
: call (false)
|
||||
, invoke (false)
|
||||
, alloc (false)
|
||||
, dealloc (false)
|
||||
, cont (false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct test_handler
|
||||
{
|
||||
std::reference_wrapper <test_results> results;
|
||||
|
||||
explicit test_handler (test_results& results_)
|
||||
: results (results_)
|
||||
{
|
||||
}
|
||||
|
||||
void operator() ()
|
||||
{
|
||||
results.get().call = true;
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend void asio_handler_invoke (
|
||||
Function& f, test_handler* h)
|
||||
{
|
||||
h->results.get().invoke = true;
|
||||
f();
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend void asio_handler_invoke (
|
||||
Function const& f, test_handler* h)
|
||||
{
|
||||
h->results.get().invoke = true;
|
||||
f();
|
||||
}
|
||||
|
||||
friend void* asio_handler_allocate (
|
||||
std::size_t size, test_handler* h)
|
||||
{
|
||||
h->results.get().alloc = true;
|
||||
return boost::asio::asio_handler_allocate (size);
|
||||
}
|
||||
|
||||
friend void asio_handler_deallocate (
|
||||
void* p, std::size_t size, test_handler* h)
|
||||
{
|
||||
h->results.get().dealloc = true;
|
||||
boost::asio::asio_handler_deallocate (p, size);
|
||||
}
|
||||
|
||||
friend bool asio_handler_is_continuation (
|
||||
test_handler* h)
|
||||
{
|
||||
h->results.get().cont = true;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
struct test_invokable
|
||||
{
|
||||
bool call;
|
||||
|
||||
test_invokable ()
|
||||
: call (false)
|
||||
{
|
||||
}
|
||||
|
||||
void operator() ()
|
||||
{
|
||||
call = true;
|
||||
}
|
||||
};
|
||||
|
||||
template <class Handler>
|
||||
bool async_op (Handler&& handler)
|
||||
{
|
||||
void* const p (boost_asio_handler_alloc_helpers::allocate (32, handler));
|
||||
handler();
|
||||
boost_asio_handler_alloc_helpers::deallocate (p, 32, handler);
|
||||
return boost_asio_handler_cont_helpers::is_continuation (handler);
|
||||
}
|
||||
|
||||
void virtual_async_op (asio::shared_handler <void(void)> handler)
|
||||
{
|
||||
async_op (handler);
|
||||
}
|
||||
|
||||
void runTest()
|
||||
{
|
||||
beginTestCase ("hooks");
|
||||
|
||||
#if ! BEAST_NO_STD_FUNCTION_CONSTRUCTIBLE
|
||||
static_assert (! std::is_constructible <
|
||||
std::function <void(void)>, int&&>::value,
|
||||
"Cannot construct std::function from int&&");
|
||||
|
||||
static_assert (! std::is_constructible <
|
||||
std::function <void(void)>, int>::value,
|
||||
"Cannot construct std::function from int");
|
||||
|
||||
static_assert (! std::is_constructible <
|
||||
asio::shared_handler <void(void)>, int>::value,
|
||||
"Cannot construct shared_handler from int");
|
||||
#endif
|
||||
|
||||
static_assert (std::is_constructible <
|
||||
asio::shared_handler <void(int)>,
|
||||
asio::shared_handler <void(int)>>::value,
|
||||
"Should construct <void(int)> from <void(int)>");
|
||||
|
||||
static_assert (! std::is_constructible <
|
||||
asio::shared_handler <void(int)>,
|
||||
asio::shared_handler <void(void)>>::value,
|
||||
"Can't construct <void(int)> from <void(void)>");
|
||||
|
||||
// Hooks called when using the raw handler
|
||||
{
|
||||
test_results r;
|
||||
test_handler h (r);
|
||||
|
||||
async_op (h);
|
||||
expect (r.call);
|
||||
expect (r.alloc);
|
||||
expect (r.dealloc);
|
||||
expect (r.cont);
|
||||
|
||||
test_invokable f;
|
||||
boost_asio_handler_invoke_helpers::invoke (std::ref (f), h);
|
||||
expect (r.invoke);
|
||||
expect (f.call);
|
||||
}
|
||||
|
||||
// Use of std::function shows the hooks not getting called
|
||||
{
|
||||
test_results r;
|
||||
std::function <void(void)> fh ((test_handler) (r));
|
||||
|
||||
async_op (fh);
|
||||
expect (r.call);
|
||||
unexpected (r.alloc);
|
||||
unexpected (r.dealloc);
|
||||
unexpected (r.cont);
|
||||
|
||||
test_invokable f;
|
||||
boost_asio_handler_invoke_helpers::invoke (std::ref (f), fh);
|
||||
unexpected (r.invoke);
|
||||
expect (f.call);
|
||||
}
|
||||
|
||||
// Make sure shared_handler calls the hooks
|
||||
{
|
||||
test_results r;
|
||||
asio::shared_handler <void(void)> sh ((test_handler)(r));
|
||||
|
||||
async_op (sh);
|
||||
expect (r.call);
|
||||
expect (r.alloc);
|
||||
expect (r.dealloc);
|
||||
expect (r.cont);
|
||||
|
||||
test_invokable f;
|
||||
boost_asio_handler_invoke_helpers::invoke (std::ref (f), sh);
|
||||
expect (r.invoke);
|
||||
expect (f.call);
|
||||
}
|
||||
|
||||
// Make sure shared_handler via implicit conversion calls hooks
|
||||
{
|
||||
test_results r;
|
||||
test_handler h (r);
|
||||
|
||||
virtual_async_op ((test_handler) (r));
|
||||
expect (r.call);
|
||||
expect (r.alloc);
|
||||
expect (r.dealloc);
|
||||
expect (r.cont);
|
||||
}
|
||||
}
|
||||
|
||||
shared_handler_Tests() : UnitTest ("shared_handler", "beast")
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static shared_handler_Tests shared_handler_tests;
|
||||
|
||||
}
|
||||
287
src/beast/beast/asio/tests/wrap_handler_tests.cpp
Normal file
287
src/beast/beast/asio/tests/wrap_handler_tests.cpp
Normal file
@@ -0,0 +1,287 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
||||
|
||||
#include "../wrap_handler.h"
|
||||
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Displays the order of destruction of parameters in the bind wrapper
|
||||
//
|
||||
class boost_bind_Tests : public UnitTest
|
||||
{
|
||||
public:
|
||||
struct Result
|
||||
{
|
||||
std::string text;
|
||||
|
||||
void push_back (std::string const& s)
|
||||
{
|
||||
if (! text.empty())
|
||||
text += ", ";
|
||||
text += s;
|
||||
}
|
||||
};
|
||||
|
||||
struct Payload
|
||||
{
|
||||
std::reference_wrapper <Result> m_result;
|
||||
std::string m_name;
|
||||
|
||||
explicit Payload (Result& result, std::string const& name)
|
||||
: m_result (result)
|
||||
, m_name (name)
|
||||
{
|
||||
}
|
||||
|
||||
~Payload ()
|
||||
{
|
||||
m_result.get().push_back (m_name);
|
||||
}
|
||||
};
|
||||
|
||||
struct Arg
|
||||
{
|
||||
std::shared_ptr <Payload> m_payload;
|
||||
|
||||
Arg (Result& result, std::string const& name)
|
||||
: m_payload (std::make_shared <Payload> (result, name))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static void foo (Arg const&, Arg const&, Arg const&)
|
||||
{
|
||||
}
|
||||
|
||||
void runTest()
|
||||
{
|
||||
beginTestCase ("order");
|
||||
|
||||
{
|
||||
Result r;
|
||||
{
|
||||
boost::bind (&foo,
|
||||
Arg (r, "one"),
|
||||
Arg (r, "two"),
|
||||
Arg (r, "three"));
|
||||
}
|
||||
logMessage (std::string ("boost::bind (") + r.text + ")");
|
||||
}
|
||||
|
||||
{
|
||||
Result r;
|
||||
{
|
||||
std::bind (&foo,
|
||||
Arg (r, "one"),
|
||||
Arg (r, "two"),
|
||||
Arg (r, "three"));
|
||||
}
|
||||
logMessage (std::string ("std::bind (") + r.text + ")");
|
||||
}
|
||||
|
||||
pass();
|
||||
}
|
||||
|
||||
boost_bind_Tests() : UnitTest ("bind", "beast", runManual)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static boost_bind_Tests boost_bind_tests;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class wrap_handler_handler_Tests : public UnitTest
|
||||
{
|
||||
public:
|
||||
struct test_results
|
||||
{
|
||||
bool call;
|
||||
bool invoke;
|
||||
bool alloc;
|
||||
bool dealloc;
|
||||
bool cont;
|
||||
|
||||
test_results ()
|
||||
: call (false)
|
||||
, invoke (false)
|
||||
, alloc (false)
|
||||
, dealloc (false)
|
||||
, cont (false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct test_handler
|
||||
{
|
||||
std::reference_wrapper <test_results> results;
|
||||
|
||||
explicit test_handler (test_results& results_)
|
||||
: results (results_)
|
||||
{
|
||||
}
|
||||
|
||||
void operator() ()
|
||||
{
|
||||
results.get().call = true;
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend void asio_handler_invoke (
|
||||
Function& f, test_handler* h)
|
||||
{
|
||||
h->results.get().invoke = true;
|
||||
f();
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend void asio_handler_invoke (
|
||||
Function const& f, test_handler* h)
|
||||
{
|
||||
h->results.get().invoke = true;
|
||||
f();
|
||||
}
|
||||
|
||||
friend void* asio_handler_allocate (
|
||||
std::size_t, test_handler* h)
|
||||
{
|
||||
h->results.get().alloc = true;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
friend void asio_handler_deallocate (
|
||||
void*, std::size_t, test_handler* h)
|
||||
{
|
||||
h->results.get().dealloc = true;
|
||||
}
|
||||
|
||||
friend bool asio_handler_is_continuation (
|
||||
test_handler* h)
|
||||
{
|
||||
h->results.get().cont = true;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
struct test_invokable
|
||||
{
|
||||
bool call;
|
||||
|
||||
test_invokable ()
|
||||
: call (false)
|
||||
{
|
||||
}
|
||||
|
||||
void operator() ()
|
||||
{
|
||||
call = true;
|
||||
}
|
||||
};
|
||||
|
||||
template <class Handler>
|
||||
bool async_op (Handler&& handler)
|
||||
{
|
||||
void* const p (boost_asio_handler_alloc_helpers::allocate (32, handler));
|
||||
(handler)();
|
||||
boost_asio_handler_alloc_helpers::deallocate (p, 32, handler);
|
||||
return boost_asio_handler_cont_helpers::is_continuation (handler);
|
||||
}
|
||||
|
||||
void runTest()
|
||||
{
|
||||
beginTestCase ("hooks");
|
||||
|
||||
// Hooks called when using the raw handler
|
||||
{
|
||||
test_results r;
|
||||
test_handler h (r);
|
||||
|
||||
async_op (h);
|
||||
expect (r.call);
|
||||
expect (r.alloc);
|
||||
expect (r.dealloc);
|
||||
expect (r.cont);
|
||||
|
||||
test_invokable f;
|
||||
boost_asio_handler_invoke_helpers::invoke (std::ref (f), h);
|
||||
expect (r.invoke);
|
||||
expect (f.call);
|
||||
}
|
||||
|
||||
// Use of boost::bind shows the hooks not getting called
|
||||
{
|
||||
test_results r;
|
||||
test_handler h (r);
|
||||
auto b (std::bind (&test_handler::operator(), &h));
|
||||
|
||||
async_op (b);
|
||||
expect (r.call);
|
||||
unexpected (r.alloc);
|
||||
unexpected (r.dealloc);
|
||||
unexpected (r.cont);
|
||||
|
||||
test_invokable f;
|
||||
boost_asio_handler_invoke_helpers::invoke (std::ref (f), b);
|
||||
unexpected (r.invoke);
|
||||
expect (f.call);
|
||||
}
|
||||
|
||||
// Make sure the wrapped handler calls the hooks
|
||||
{
|
||||
test_results r;
|
||||
test_handler h (r);
|
||||
auto w (wrap_handler (
|
||||
std::bind (&test_handler::operator(), test_handler(r)), h));
|
||||
|
||||
async_op (w);
|
||||
expect (r.call);
|
||||
expect (r.alloc);
|
||||
expect (r.dealloc);
|
||||
expect (r.cont);
|
||||
|
||||
test_invokable f;
|
||||
boost_asio_handler_invoke_helpers::invoke (std::ref (f), w);
|
||||
expect (r.invoke);
|
||||
expect (f.call);
|
||||
}
|
||||
}
|
||||
|
||||
wrap_handler_handler_Tests() : UnitTest ("wrap_handler", "beast")
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static wrap_handler_handler_Tests wrap_handler_handler_tests;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
176
src/beast/beast/asio/wrap_handler.h
Normal file
176
src/beast/beast/asio/wrap_handler.h
Normal file
@@ -0,0 +1,176 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_ASIO_WRAP_HANDLER_H_INCLUDED
|
||||
#define BEAST_ASIO_WRAP_HANDLER_H_INCLUDED
|
||||
|
||||
#include <boost/asio/detail/handler_alloc_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_cont_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_invoke_helpers.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4512) // assignment operator could not be generated
|
||||
#endif
|
||||
|
||||
namespace detail {
|
||||
|
||||
/** A handler which wraps another handler using a specfic context.
|
||||
The handler is invoked with the same io_service execution guarantees
|
||||
as the provided context.
|
||||
@note A copy of Context is made.
|
||||
*/
|
||||
template <class Handler, class Context>
|
||||
class wrapped_handler
|
||||
{
|
||||
private:
|
||||
Handler m_handler;
|
||||
Context m_context;
|
||||
bool m_continuation;
|
||||
|
||||
// If this goes off, consider carefully what the intent is.
|
||||
static_assert (! std::is_reference <Handler>::value,
|
||||
"Handler should not be a reference type");
|
||||
|
||||
public:
|
||||
wrapped_handler (bool continuation, Handler&& handler, Context context)
|
||||
: m_handler (std::move (handler))
|
||||
, m_context (context)
|
||||
, m_continuation (continuation ? true :
|
||||
boost_asio_handler_cont_helpers::is_continuation (context))
|
||||
{
|
||||
}
|
||||
|
||||
wrapped_handler (bool continuation, Handler const& handler, Context context)
|
||||
: m_handler (handler)
|
||||
, m_context (context)
|
||||
, m_continuation (continuation ? true :
|
||||
boost_asio_handler_cont_helpers::is_continuation (context))
|
||||
{
|
||||
}
|
||||
|
||||
template <class... Args>
|
||||
void
|
||||
operator() (Args&&... args)
|
||||
{
|
||||
m_handler (std::forward <Args> (args)...);
|
||||
}
|
||||
|
||||
template <class... Args>
|
||||
void
|
||||
operator() (Args&&... args) const
|
||||
{
|
||||
m_handler (std::forward <Args> (args)...);
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend
|
||||
void
|
||||
asio_handler_invoke (Function& f, wrapped_handler* h)
|
||||
{
|
||||
boost_asio_handler_invoke_helpers::
|
||||
invoke (f, h->m_context);
|
||||
}
|
||||
|
||||
template <class Function>
|
||||
friend
|
||||
void
|
||||
asio_handler_invoke (Function const& f, wrapped_handler* h)
|
||||
{
|
||||
boost_asio_handler_invoke_helpers::
|
||||
invoke (f, h->m_context);
|
||||
}
|
||||
|
||||
friend
|
||||
void*
|
||||
asio_handler_allocate (std::size_t size, wrapped_handler* h)
|
||||
{
|
||||
return boost_asio_handler_alloc_helpers::
|
||||
allocate (size, h->m_context);
|
||||
}
|
||||
|
||||
friend
|
||||
void
|
||||
asio_handler_deallocate (void* p, std::size_t size, wrapped_handler* h)
|
||||
{
|
||||
boost_asio_handler_alloc_helpers::
|
||||
deallocate (p, size, h->m_context);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation (wrapped_handler* h)
|
||||
{
|
||||
return h->m_continuation;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Tag for dispatching wrap_handler with is_continuation == true
|
||||
enum continuation_t
|
||||
{
|
||||
continuation
|
||||
};
|
||||
|
||||
/** Returns a wrapped handler so it executes within another context.
|
||||
The handler is invoked with the same io_service execution guarantees
|
||||
as the provided context. The handler will be copied if necessary.
|
||||
@note A copy of Context is made.
|
||||
*/
|
||||
/** @{ */
|
||||
template <class DeducedHandler, class Context>
|
||||
detail::wrapped_handler <
|
||||
std::remove_reference_t <DeducedHandler>,
|
||||
Context
|
||||
>
|
||||
wrap_handler (DeducedHandler&& handler, Context const& context,
|
||||
bool continuation = false)
|
||||
{
|
||||
typedef std::remove_reference_t <DeducedHandler> Handler;
|
||||
return detail::wrapped_handler <Handler, Context> (continuation,
|
||||
std::forward <DeducedHandler> (handler), context);
|
||||
}
|
||||
|
||||
template <class DeducedHandler, class Context>
|
||||
detail::wrapped_handler <
|
||||
std::remove_reference_t <DeducedHandler>,
|
||||
Context
|
||||
>
|
||||
wrap_handler (continuation_t, DeducedHandler&& handler,
|
||||
Context const& context)
|
||||
{
|
||||
typedef std::remove_reference_t <DeducedHandler> Handler;
|
||||
return detail::wrapped_handler <Handler, Context> (true,
|
||||
std::forward <DeducedHandler> (handler), context);
|
||||
}
|
||||
/** @} */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
46
src/beast/beast/boost/get_pointer.h
Normal file
46
src/beast/beast/boost/get_pointer.h
Normal file
@@ -0,0 +1,46 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_BOOST_GET_POINTER_H_INCLUDED
|
||||
#define BEAST_BOOST_GET_POINTER_H_INCLUDED
|
||||
|
||||
#include <boost/get_pointer.hpp>
|
||||
|
||||
// Boost 1.55 incorrectly defines BOOST_NO_CXX11_SMART_PTR
|
||||
// when building with clang 3.4 and earlier. This workaround
|
||||
// gives beast its own overloads.
|
||||
|
||||
#ifdef BOOST_NO_CXX11_SMART_PTR
|
||||
#include <memory>
|
||||
namespace beast {
|
||||
template <class T>
|
||||
T* get_pointer (std::unique_ptr<T> const& p)
|
||||
{
|
||||
return p.get();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T* get_pointer (std::shared_ptr<T> const& p)
|
||||
{
|
||||
return p.get();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "impl/abstract_clock.cpp"
|
||||
#include "impl/chrono_io.cpp"
|
||||
#include "impl/basic_seconds_clock.cpp"
|
||||
|
||||
#include "impl/CPUMeter.cpp"
|
||||
#include "impl/RelativeTime.cpp"
|
||||
|
||||
@@ -72,15 +72,15 @@ public:
|
||||
virtual bool is_steady () const = 0;
|
||||
|
||||
/** Returns the current time. */
|
||||
virtual time_point now () = 0;
|
||||
virtual time_point now () const = 0;
|
||||
|
||||
/** Convert the specified time point to a string. */
|
||||
/** @{ */
|
||||
virtual std::string to_string (time_point const& tp) = 0;
|
||||
virtual std::string to_string (time_point const& tp) const = 0;
|
||||
|
||||
template <class Duration2>
|
||||
std::string to_string (
|
||||
std::chrono::time_point <abstract_clock, Duration2> const& tp)
|
||||
std::chrono::time_point <abstract_clock, Duration2> const& tp) const
|
||||
{
|
||||
return to_string (
|
||||
std::chrono::time_point_cast <Duration> (tp));
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
/** @} */
|
||||
|
||||
/** Returning elapsed ticks since the epoch. */
|
||||
rep elapsed ()
|
||||
rep elapsed () const
|
||||
{
|
||||
return now().time_since_epoch().count();
|
||||
}
|
||||
@@ -109,7 +109,7 @@ struct basic_abstract_clock_wrapper : public abstract_clock <Duration>
|
||||
return TrivialClock::is_steady;
|
||||
}
|
||||
|
||||
time_point now ()
|
||||
time_point now () const
|
||||
{
|
||||
return time_point (duration (
|
||||
std::chrono::duration_cast <duration> (
|
||||
@@ -121,9 +121,9 @@ template <class TrivialClock, class Duration>
|
||||
struct abstract_clock_wrapper
|
||||
: public basic_abstract_clock_wrapper <TrivialClock, Duration>
|
||||
{
|
||||
// generic conversion displays the duration
|
||||
// generic conversion displays the duration
|
||||
std::string to_string (typename basic_abstract_clock_wrapper <
|
||||
TrivialClock, Duration>::time_point const& tp)
|
||||
TrivialClock, Duration>::time_point const& tp) const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << tp.time_since_epoch();
|
||||
|
||||
237
src/beast/beast/chrono/basic_seconds_clock.h
Normal file
237
src/beast/beast/chrono/basic_seconds_clock.h
Normal file
@@ -0,0 +1,237 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CHRONO_BASIC_SECONDS_CLOCK_H_INCLUDED
|
||||
#define BEAST_CHRONO_BASIC_SECONDS_CLOCK_H_INCLUDED
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
|
||||
#ifndef BEAST_BASIC_SECONDS_CLOCK_BOOST_WORKAROUND
|
||||
# ifdef _MSC_VER
|
||||
// Visual Studio 2012, 2013 have a bug in std::thread that
|
||||
// causes a hang on exit, in the library function atexit()
|
||||
# if BEAST_USE_BOOST_FEATURES
|
||||
# define BEAST_BASIC_SECONDS_CLOCK_BOOST_WORKAROUND 1
|
||||
# else
|
||||
# define BEAST_BASIC_SECONDS_CLOCK_BOOST_WORKAROUND 0
|
||||
# endif
|
||||
# else
|
||||
# define BEAST_BASIC_SECONDS_CLOCK_BOOST_WORKAROUND 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if BEAST_BASIC_SECONDS_CLOCK_BOOST_WORKAROUND
|
||||
# include <boost/version.hpp>
|
||||
# if BOOST_VERSION >= 105500
|
||||
# include <boost/thread/thread.hpp>
|
||||
# include <boost/thread/mutex.hpp>
|
||||
# include <boost/thread/condition_variable.hpp>
|
||||
# include <boost/chrono.hpp>
|
||||
# else
|
||||
# error "Boost version 1.55.0 or later is required"
|
||||
# endif
|
||||
#else
|
||||
# include <condition_variable>
|
||||
# include <mutex>
|
||||
# include <thread>
|
||||
#endif
|
||||
|
||||
#include "../chrono/chrono_util.h"
|
||||
|
||||
namespace beast {
|
||||
|
||||
namespace detail {
|
||||
|
||||
class seconds_clock_worker
|
||||
{
|
||||
public:
|
||||
virtual void sample () = 0;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Updates the clocks
|
||||
class seconds_clock_thread
|
||||
{
|
||||
public:
|
||||
#if BEAST_BASIC_SECONDS_CLOCK_BOOST_WORKAROUND
|
||||
typedef boost::mutex mutex;
|
||||
typedef boost::condition_variable cond_var;
|
||||
typedef boost::lock_guard <mutex> lock_guard;
|
||||
typedef boost::unique_lock <mutex> unique_lock;
|
||||
typedef boost::chrono::steady_clock clock_type;
|
||||
typedef boost::chrono::seconds seconds;
|
||||
typedef boost::thread thread;
|
||||
#else
|
||||
typedef std::mutex mutex;
|
||||
typedef std::condition_variable cond_var;
|
||||
typedef std::lock_guard <mutex> lock_guard;
|
||||
typedef std::unique_lock <mutex> unique_lock;
|
||||
typedef std::chrono::steady_clock clock_type;
|
||||
typedef std::chrono::seconds seconds;
|
||||
typedef std::thread thread;
|
||||
#endif
|
||||
typedef std::vector <seconds_clock_worker*> workers;
|
||||
|
||||
bool m_stop;
|
||||
mutex m_mutex;
|
||||
cond_var m_cond;
|
||||
workers m_workers;
|
||||
thread m_thread;
|
||||
|
||||
seconds_clock_thread ()
|
||||
: m_stop (false)
|
||||
{
|
||||
m_thread = thread (std::bind(
|
||||
&seconds_clock_thread::run, this));
|
||||
}
|
||||
|
||||
~seconds_clock_thread ()
|
||||
{
|
||||
{
|
||||
lock_guard lock (m_mutex);
|
||||
m_stop = true;
|
||||
}
|
||||
m_cond.notify_all();
|
||||
m_thread.join ();
|
||||
}
|
||||
|
||||
void add (seconds_clock_worker& w)
|
||||
{
|
||||
lock_guard lock (m_mutex);
|
||||
m_workers.push_back (&w);
|
||||
}
|
||||
|
||||
void remove (seconds_clock_worker& w)
|
||||
{
|
||||
lock_guard lock (m_mutex);
|
||||
m_workers.erase (std::find (
|
||||
m_workers.begin (), m_workers.end(), &w));
|
||||
}
|
||||
|
||||
void run ()
|
||||
{
|
||||
unique_lock lock (m_mutex);;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
for (auto iter : m_workers)
|
||||
iter->sample();
|
||||
|
||||
clock_type::time_point const when (
|
||||
floor <seconds> (
|
||||
clock_type::now().time_since_epoch()) +
|
||||
seconds (1));
|
||||
|
||||
if (m_cond.wait_until (lock, when, [this]{ return m_stop; }))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static seconds_clock_thread& instance ()
|
||||
{
|
||||
static seconds_clock_thread singleton;
|
||||
return singleton;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** A clock whose minimum resolution is one second.
|
||||
The purpose of this class is to optimize the performance of the now()
|
||||
member function call. It uses a dedicated thread that wakes up at least
|
||||
once per second to sample the requested trivial clock.
|
||||
@tparam TrivialClock The clock to sample.
|
||||
*/
|
||||
template <class TrivialClock>
|
||||
class basic_seconds_clock
|
||||
{
|
||||
public:
|
||||
typedef std::chrono::seconds resolution;
|
||||
typedef typename resolution::rep rep;
|
||||
typedef typename resolution::period period;
|
||||
typedef std::chrono::duration <rep, period> duration;
|
||||
typedef std::chrono::time_point <basic_seconds_clock> time_point;
|
||||
|
||||
static bool const is_steady = TrivialClock::is_steady;
|
||||
|
||||
static time_point now ()
|
||||
{
|
||||
// Make sure the thread is constructed before the
|
||||
// worker otherwise we will crash during destruction
|
||||
// of objects with static storage duration.
|
||||
struct initializer
|
||||
{
|
||||
initializer ()
|
||||
{
|
||||
detail::seconds_clock_thread::instance();
|
||||
}
|
||||
};
|
||||
static initializer init;
|
||||
|
||||
struct worker : detail::seconds_clock_worker
|
||||
{
|
||||
typedef std::mutex mutex;
|
||||
typedef std::lock_guard <mutex> lock_guard;
|
||||
|
||||
time_point m_now;
|
||||
mutex m_mutex;
|
||||
|
||||
static time_point get_now ()
|
||||
{
|
||||
return time_point (floor <resolution> (
|
||||
TrivialClock::now().time_since_epoch()));
|
||||
}
|
||||
|
||||
worker ()
|
||||
: m_now (get_now ())
|
||||
{
|
||||
detail::seconds_clock_thread::instance().add (*this);
|
||||
}
|
||||
|
||||
~worker ()
|
||||
{
|
||||
detail::seconds_clock_thread::instance().remove (*this);
|
||||
}
|
||||
|
||||
time_point now()
|
||||
{
|
||||
lock_guard lock (m_mutex);
|
||||
return m_now;
|
||||
}
|
||||
|
||||
void sample ()
|
||||
{
|
||||
lock_guard lock (m_mutex);
|
||||
m_now = get_now ();
|
||||
}
|
||||
};
|
||||
|
||||
static worker w;
|
||||
|
||||
return w.now ();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -17,26 +17,50 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
boost::system::error_code SocketBase::pure_virtual_error ()
|
||||
#ifndef BEAST_CHRONO_UTIL_H_INCLUDED
|
||||
#define BEAST_CHRONO_UTIL_H_INCLUDED
|
||||
|
||||
// From Howard Hinnant
|
||||
// http://home.roadrunner.com/~hinnant/duration_io/chrono_util.html
|
||||
|
||||
// round down
|
||||
template <class To, class Rep, class Period>
|
||||
To floor(std::chrono::duration <Rep, Period> const& d)
|
||||
{
|
||||
return boost::system::errc::make_error_code (
|
||||
boost::system::errc::function_not_supported);
|
||||
To t = std::chrono::duration_cast<To>(d);
|
||||
if (t > d)
|
||||
--t;
|
||||
return t;
|
||||
}
|
||||
|
||||
boost::system::error_code SocketBase::pure_virtual_error (error_code& ec,
|
||||
char const* fileName, int lineNumber)
|
||||
// round to nearest, to even on tie
|
||||
template <class To, class Rep, class Period>
|
||||
To round (std::chrono::duration <Rep, Period> const& d)
|
||||
{
|
||||
pure_virtual_called (fileName, lineNumber);
|
||||
return ec = pure_virtual_error ();
|
||||
To t0 = std::chrono::duration_cast<To>(d);
|
||||
To t1 = t0;
|
||||
++t1;
|
||||
auto diff0 = d - t0;
|
||||
auto diff1 = t1 - d;
|
||||
if (diff0 == diff1)
|
||||
{
|
||||
if (t0.count() & 1)
|
||||
return t1;
|
||||
return t0;
|
||||
}
|
||||
else if (diff0 < diff1)
|
||||
return t0;
|
||||
return t1;
|
||||
}
|
||||
|
||||
void SocketBase::pure_virtual_called (char const* fileName, int lineNumber)
|
||||
// round up
|
||||
template <class To, class Rep, class Period>
|
||||
To ceil (std::chrono::duration <Rep, Period> const& d)
|
||||
{
|
||||
Throw (std::runtime_error ("pure virtual called"), fileName, lineNumber);
|
||||
To t = std::chrono::duration_cast<To>(d);
|
||||
if (t < d)
|
||||
++t;
|
||||
return t;
|
||||
}
|
||||
|
||||
void SocketBase::throw_error (error_code const& ec, char const* fileName, int lineNumber)
|
||||
{
|
||||
if (ec)
|
||||
Throw (boost::system::system_error (ec), fileName, lineNumber);
|
||||
}
|
||||
#endif
|
||||
46
src/beast/beast/chrono/impl/basic_seconds_clock.cpp
Normal file
46
src/beast/beast/chrono/impl/basic_seconds_clock.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../basic_seconds_clock.h"
|
||||
|
||||
#include "../../Config.h"
|
||||
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
||||
|
||||
namespace beast {
|
||||
|
||||
class basic_seconds_clock_Tests : public UnitTest
|
||||
{
|
||||
public:
|
||||
void runTest ()
|
||||
{
|
||||
beginTestCase ("now");
|
||||
|
||||
basic_seconds_clock <std::chrono::steady_clock>::now ();
|
||||
|
||||
pass ();
|
||||
}
|
||||
|
||||
basic_seconds_clock_Tests() : UnitTest("basic_seconds_clock", "beast")
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static basic_seconds_clock_Tests basic_seconds_clock_tests;
|
||||
|
||||
}
|
||||
@@ -48,12 +48,12 @@ public:
|
||||
return IsSteady;
|
||||
}
|
||||
|
||||
time_point now ()
|
||||
time_point now () const
|
||||
{
|
||||
return m_now;
|
||||
}
|
||||
|
||||
std::string to_string (time_point const& tp)
|
||||
std::string to_string (time_point const& tp) const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << tp.time_since_epoch() << " from start";
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#error "PlatformConfig.h must come first!"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
// This file defines miscellaneous macros for debugging, assertions, etc.
|
||||
|
||||
#if BEAST_FORCE_DEBUG
|
||||
@@ -109,6 +111,7 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
|
||||
*/
|
||||
#define BDBG(dbgtext) { beast::String tempDbgBuf; tempDbgBuf << dbgtext; beast::Logger::outputDebugString (tempDbgBuf); }
|
||||
|
||||
#if 0
|
||||
/** This will always cause an assertion failure.
|
||||
It is only compiled in a debug build, (unless BEAST_LOG_ASSERTIONS is enabled for your build).
|
||||
@see bassert
|
||||
@@ -122,6 +125,11 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
|
||||
@see bassertfalse
|
||||
*/
|
||||
#define bassert(expression) { if (! (expression)) beast_reportFatalError(#expression,__FILE__,__LINE__); }
|
||||
#else
|
||||
|
||||
#define bassertfalse assert(false)
|
||||
#define bassert(expression) assert(expression)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -18,3 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
// Microsoft Visual C++ compiler configuration
|
||||
|
||||
#ifndef noexcept
|
||||
# define noexcept throw()
|
||||
#endif
|
||||
|
||||
25
src/beast/beast/container/Container.cpp
Normal file
25
src/beast/beast/container/Container.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "impl/aged_associative_container.cpp"
|
||||
|
||||
#include "tests/buffer_view.test.cpp"
|
||||
|
||||
@@ -17,16 +17,18 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_STL_SHARED_PTR_H_INCLUDED
|
||||
#define BEAST_STL_SHARED_PTR_H_INCLUDED
|
||||
#ifndef BEAST_CONTAINER_AGED_CONTAINER_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_CONTAINER_H_INCLUDED
|
||||
|
||||
#include <boost/smart_ptr.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace beast {
|
||||
|
||||
using boost::shared_ptr;
|
||||
using boost::make_shared;
|
||||
using boost::enable_shared_from_this;
|
||||
template <class T>
|
||||
struct is_aged_container
|
||||
: std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
51
src/beast/beast/container/aged_container_utility.h
Normal file
51
src/beast/beast/container/aged_container_utility.h
Normal file
@@ -0,0 +1,51 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_CONTAINER_UTILITY_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_CONTAINER_UTILITY_H_INCLUDED
|
||||
|
||||
#include "aged_container.h"
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace beast {
|
||||
|
||||
/** Expire aged container items past the specified age. */
|
||||
template <class AgedContainer, class Rep, class Period>
|
||||
typename std::enable_if <
|
||||
is_aged_container <AgedContainer>::value,
|
||||
std::size_t
|
||||
>::type
|
||||
expire (AgedContainer& c, std::chrono::duration <Rep, Period> const& age)
|
||||
{
|
||||
std::size_t n (0);
|
||||
auto const expired (c.clock().now() - age);
|
||||
for (auto iter (c.chronological.cbegin());
|
||||
iter != c.chronological.cend() &&
|
||||
iter.when() <= expired;)
|
||||
{
|
||||
iter = c.erase (iter);
|
||||
++n;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
43
src/beast/beast/container/aged_map.h
Normal file
43
src/beast/beast/container/aged_map.h
Normal file
@@ -0,0 +1,43 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_MAP_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_MAP_H_INCLUDED
|
||||
|
||||
#include "detail/aged_ordered_container.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class T,
|
||||
class Duration = std::chrono::seconds,
|
||||
class Compare = std::less <Key>,
|
||||
class Allocator = std::allocator <std::pair <Key const, T>>
|
||||
>
|
||||
using aged_map = detail::aged_ordered_container <
|
||||
false, true, Key, T, Duration, Compare, Allocator>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
43
src/beast/beast/container/aged_multimap.h
Normal file
43
src/beast/beast/container/aged_multimap.h
Normal file
@@ -0,0 +1,43 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_MULTIMAP_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_MULTIMAP_H_INCLUDED
|
||||
|
||||
#include "detail/aged_ordered_container.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class T,
|
||||
class Duration = std::chrono::seconds,
|
||||
class Compare = std::less <Key>,
|
||||
class Allocator = std::allocator <std::pair <Key const, T>>
|
||||
>
|
||||
using aged_multimap = detail::aged_ordered_container <
|
||||
true, true, Key, T, Duration, Compare, Allocator>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
42
src/beast/beast/container/aged_multiset.h
Normal file
42
src/beast/beast/container/aged_multiset.h
Normal file
@@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_MULTISET_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_MULTISET_H_INCLUDED
|
||||
|
||||
#include "detail/aged_ordered_container.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class Duration = std::chrono::seconds,
|
||||
class Compare = std::less <Key>,
|
||||
class Allocator = std::allocator <Key>
|
||||
>
|
||||
using aged_multiset = detail::aged_ordered_container <
|
||||
true, false, Key, void, Duration, Compare, Allocator>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
42
src/beast/beast/container/aged_set.h
Normal file
42
src/beast/beast/container/aged_set.h
Normal file
@@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_SET_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_SET_H_INCLUDED
|
||||
|
||||
#include "detail/aged_ordered_container.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class Duration = std::chrono::seconds,
|
||||
class Compare = std::less <Key>,
|
||||
class Allocator = std::allocator <Key>
|
||||
>
|
||||
using aged_set = detail::aged_ordered_container <
|
||||
false, false, Key, void, Duration, Compare, Allocator>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
44
src/beast/beast/container/aged_unordered_map.h
Normal file
44
src/beast/beast/container/aged_unordered_map.h
Normal file
@@ -0,0 +1,44 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_UNORDERED_MAP_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_UNORDERED_MAP_H_INCLUDED
|
||||
|
||||
#include "detail/aged_unordered_container.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class T,
|
||||
class Duration = std::chrono::seconds,
|
||||
class Hash = std::hash <Key>,
|
||||
class KeyEqual = std::equal_to <Key>,
|
||||
class Allocator = std::allocator <std::pair <Key const, T>>
|
||||
>
|
||||
using aged_unordered_map = detail::aged_unordered_container <
|
||||
false, true, Key, T, Duration, Hash, KeyEqual, Allocator>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
44
src/beast/beast/container/aged_unordered_multimap.h
Normal file
44
src/beast/beast/container/aged_unordered_multimap.h
Normal file
@@ -0,0 +1,44 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_UNORDERED_MULTIMAP_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_UNORDERED_MULTIMAP_H_INCLUDED
|
||||
|
||||
#include "detail/aged_unordered_container.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class T,
|
||||
class Duration = std::chrono::seconds,
|
||||
class Hash = std::hash <Key>,
|
||||
class KeyEqual = std::equal_to <Key>,
|
||||
class Allocator = std::allocator <std::pair <Key const, T>>
|
||||
>
|
||||
using aged_unordered_multimap = detail::aged_unordered_container <
|
||||
true, true, Key, T, Duration, Hash, KeyEqual, Allocator>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
43
src/beast/beast/container/aged_unordered_multiset.h
Normal file
43
src/beast/beast/container/aged_unordered_multiset.h
Normal file
@@ -0,0 +1,43 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_UNORDERED_MULTISET_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_UNORDERED_MULTISET_H_INCLUDED
|
||||
|
||||
#include "detail/aged_unordered_container.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class Duration = std::chrono::seconds,
|
||||
class Hash = std::hash <Key>,
|
||||
class KeyEqual = std::equal_to <Key>,
|
||||
class Allocator = std::allocator <Key>
|
||||
>
|
||||
using aged_unordered_multiset = detail::aged_unordered_container <
|
||||
true, false, Key, void, Duration, Hash, KeyEqual, Allocator>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
43
src/beast/beast/container/aged_unordered_set.h
Normal file
43
src/beast/beast/container/aged_unordered_set.h
Normal file
@@ -0,0 +1,43 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_UNORDERED_SET_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_UNORDERED_SET_H_INCLUDED
|
||||
|
||||
#include "detail/aged_unordered_container.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <
|
||||
class Key,
|
||||
class Duration = std::chrono::seconds,
|
||||
class Hash = std::hash <Key>,
|
||||
class KeyEqual = std::equal_to <Key>,
|
||||
class Allocator = std::allocator <Key>
|
||||
>
|
||||
using aged_unordered_set = detail::aged_unordered_container <
|
||||
false, false, Key, void, Duration, Hash, KeyEqual, Allocator>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
519
src/beast/beast/container/buffer_view.h
Normal file
519
src/beast/beast/container/buffer_view.h
Normal file
@@ -0,0 +1,519 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_BUFFER_VIEW_H_INCLUDED
|
||||
#define BEAST_CONTAINER_BUFFER_VIEW_H_INCLUDED
|
||||
|
||||
#include "../Config.h"
|
||||
|
||||
#include "../cxx14/algorithm.h" // <algorithm>
|
||||
#include <cstddef>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../cxx14/type_traits.h" // <type_traits>
|
||||
|
||||
namespace beast {
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <class T, class U,
|
||||
bool = std::is_const <std::remove_reference_t <T>>::value>
|
||||
struct apply_const
|
||||
{
|
||||
typedef U type;
|
||||
};
|
||||
|
||||
template <class T, class U>
|
||||
struct apply_const <T, U, true>
|
||||
{
|
||||
typedef const U type;
|
||||
};
|
||||
|
||||
// is_contiguous is true if C is a contiguous container
|
||||
template <class C>
|
||||
struct is_contiguous
|
||||
: public std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class C>
|
||||
struct is_contiguous <C const>
|
||||
: public is_contiguous <C>
|
||||
{
|
||||
};
|
||||
|
||||
template <class T, class Alloc>
|
||||
struct is_contiguous <std::vector <T, Alloc>>
|
||||
: public std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class CharT, class Traits, class Alloc>
|
||||
struct is_contiguous <std::basic_string<
|
||||
CharT, Traits, Alloc>>
|
||||
: public std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T, std::size_t N>
|
||||
struct is_contiguous <std::array<T, N>>
|
||||
: public std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
// True if T is const or U is not const
|
||||
template <class T, class U>
|
||||
struct buffer_view_const_compatible : std::integral_constant <bool,
|
||||
std::is_const<T>::value || ! std::is_const<U>::value
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
// True if T and U are the same or differ only in const, or
|
||||
// if T and U are equally sized integral types.
|
||||
template <class T, class U>
|
||||
struct buffer_view_ptr_compatible : std::integral_constant <bool,
|
||||
(std::is_same <std::remove_const <T>, std::remove_const <U>>::value) ||
|
||||
(std::is_integral <T>::value && std::is_integral <U>::value &&
|
||||
sizeof (U) == sizeof (T))
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
// Determine if buffer_view <T, ..> is constructible from U*
|
||||
template <class T, class U>
|
||||
struct buffer_view_convertible : std::integral_constant <bool,
|
||||
buffer_view_const_compatible <T, U>::value &&
|
||||
buffer_view_ptr_compatible <T, U>::value
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
// True if C is a container that can be used to construct a buffer_view<T>
|
||||
template <class T, class C>
|
||||
struct buffer_view_container_compatible : std::integral_constant <bool,
|
||||
is_contiguous <C>::value && buffer_view_convertible <T,
|
||||
typename apply_const <C, typename C::value_type>::type>::value
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
} // detail
|
||||
|
||||
struct buffer_view_default_tag
|
||||
{
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** A view into a range of contiguous container elements.
|
||||
|
||||
The size of the view is determined at the time of construction.
|
||||
This tries to emulate the interface of std::vector as closely as possible,
|
||||
with the constraint that the size of the container cannot be changed.
|
||||
|
||||
@tparam T The underlying element type. If T is const, member functions
|
||||
which can modify elements are removed from the interface.
|
||||
|
||||
@tparam Tag A type used to prevent two views with the same T from being
|
||||
comparable or assignable.
|
||||
*/
|
||||
template <
|
||||
class T,
|
||||
class Tag = buffer_view_default_tag
|
||||
>
|
||||
class buffer_view
|
||||
{
|
||||
private:
|
||||
T* m_base;
|
||||
std::size_t m_size;
|
||||
|
||||
static_assert (std::is_same <T, std::remove_reference_t <T>>::value,
|
||||
"T may not be a reference type");
|
||||
|
||||
static_assert (! std::is_same <T, void>::value,
|
||||
"T may not be void");
|
||||
|
||||
static_assert (std::is_same <std::add_const_t <T>,
|
||||
std::remove_reference_t <T> const>::value,
|
||||
"Expected std::add_const to produce T const");
|
||||
|
||||
template <class Iter>
|
||||
void
|
||||
assign (Iter first, Iter last) noexcept
|
||||
{
|
||||
typedef typename std::iterator_traits <Iter>::value_type U;
|
||||
|
||||
static_assert (detail::buffer_view_const_compatible <T, U>::value,
|
||||
"Cannot convert from 'U const' to 'T', "
|
||||
"conversion loses const qualifiers");
|
||||
|
||||
static_assert (detail::buffer_view_ptr_compatible <T, U>::value,
|
||||
"Cannot convert from 'U*' to 'T*, "
|
||||
"types are incompatible");
|
||||
|
||||
if (first == last)
|
||||
{
|
||||
m_base = nullptr;
|
||||
m_size = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
// fails on gcc
|
||||
m_base = reinterpret_cast <T*> (
|
||||
std::addressof (*first));
|
||||
#else
|
||||
m_base = reinterpret_cast <T*> (&*first);
|
||||
#endif
|
||||
m_size = std::distance (first, last);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T& reference;
|
||||
typedef T const& const_reference;
|
||||
typedef T* pointer;
|
||||
typedef T const* const_pointer;
|
||||
typedef T* iterator;
|
||||
typedef T const* const_iterator;
|
||||
typedef std::reverse_iterator <iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator <const_iterator> const_reverse_iterator;
|
||||
|
||||
// default construct
|
||||
buffer_view () noexcept
|
||||
: m_base (nullptr)
|
||||
, m_size (0)
|
||||
{
|
||||
}
|
||||
|
||||
// copy construct
|
||||
template <class U,
|
||||
class = std::enable_if_t <
|
||||
detail::buffer_view_convertible <T, U>::value>
|
||||
>
|
||||
buffer_view (buffer_view <U, Tag> v) noexcept
|
||||
{
|
||||
assign (v.begin(), v.end());
|
||||
}
|
||||
|
||||
// construct from container
|
||||
template <class C,
|
||||
class = std::enable_if_t <
|
||||
detail::buffer_view_container_compatible <T, C>::value
|
||||
>
|
||||
>
|
||||
buffer_view (C& c) noexcept
|
||||
{
|
||||
assign (c.begin(), c.end());
|
||||
}
|
||||
|
||||
// construct from pointer range
|
||||
template <class U,
|
||||
class = std::enable_if_t <
|
||||
detail::buffer_view_convertible <T, U>::value>
|
||||
>
|
||||
buffer_view (U* first, U* last) noexcept
|
||||
{
|
||||
assign (first, last);
|
||||
}
|
||||
|
||||
// construct from base and size
|
||||
template <class U,
|
||||
class = std::enable_if_t <
|
||||
detail::buffer_view_convertible <T, U>::value>
|
||||
>
|
||||
buffer_view (U* u, std::size_t n) noexcept
|
||||
: m_base (u)
|
||||
, m_size (n)
|
||||
{
|
||||
}
|
||||
|
||||
// assign from container
|
||||
template <class C,
|
||||
class = std::enable_if_t <
|
||||
detail::buffer_view_container_compatible <T, C>::value
|
||||
>
|
||||
>
|
||||
buffer_view&
|
||||
operator= (C& c) noexcept
|
||||
{
|
||||
assign (c.begin(), c.end());
|
||||
return *this;
|
||||
}
|
||||
|
||||
//
|
||||
// Element access
|
||||
//
|
||||
|
||||
reference
|
||||
at (size_type pos)
|
||||
{
|
||||
if (! (pos < size()))
|
||||
throw std::out_of_range ("bad array index");
|
||||
return m_base [pos];
|
||||
}
|
||||
|
||||
const_reference
|
||||
at (size_type pos) const
|
||||
{
|
||||
if (! (pos < size()))
|
||||
throw std::out_of_range ("bad array index");
|
||||
return m_base [pos];
|
||||
}
|
||||
|
||||
reference
|
||||
operator[] (size_type pos) noexcept
|
||||
{
|
||||
return m_base [pos];
|
||||
}
|
||||
|
||||
const_reference
|
||||
operator[] (size_type pos) const noexcept
|
||||
{
|
||||
return m_base [pos];
|
||||
}
|
||||
|
||||
reference
|
||||
back() noexcept
|
||||
{
|
||||
return m_base [m_size - 1];
|
||||
}
|
||||
|
||||
const_reference
|
||||
back() const noexcept
|
||||
{
|
||||
return m_base [m_size - 1];
|
||||
}
|
||||
|
||||
reference
|
||||
front() noexcept
|
||||
{
|
||||
return *m_base;
|
||||
}
|
||||
|
||||
const_reference
|
||||
front() const noexcept
|
||||
{
|
||||
return *m_base;
|
||||
}
|
||||
|
||||
pointer
|
||||
data() noexcept
|
||||
{
|
||||
return m_base;
|
||||
}
|
||||
|
||||
const_pointer
|
||||
data() const noexcept
|
||||
{
|
||||
return m_base;
|
||||
}
|
||||
|
||||
//
|
||||
// Iterators
|
||||
//
|
||||
|
||||
iterator
|
||||
begin() noexcept
|
||||
{
|
||||
return m_base;
|
||||
}
|
||||
|
||||
const_iterator
|
||||
begin() const noexcept
|
||||
{
|
||||
return m_base;
|
||||
}
|
||||
|
||||
const_iterator
|
||||
cbegin() const noexcept
|
||||
{
|
||||
return m_base;
|
||||
}
|
||||
|
||||
iterator
|
||||
end() noexcept
|
||||
{
|
||||
return m_base + m_size;
|
||||
}
|
||||
|
||||
const_iterator
|
||||
end() const noexcept
|
||||
{
|
||||
return m_base + m_size;
|
||||
}
|
||||
|
||||
const_iterator
|
||||
cend() const noexcept
|
||||
{
|
||||
return m_base + m_size;
|
||||
}
|
||||
|
||||
reverse_iterator
|
||||
rbegin() noexcept
|
||||
{
|
||||
return reverse_iterator (end());
|
||||
}
|
||||
|
||||
const_reverse_iterator
|
||||
rbegin() const noexcept
|
||||
{
|
||||
return const_reverse_iterator (cend());
|
||||
}
|
||||
|
||||
const_reverse_iterator
|
||||
crbegin() const noexcept
|
||||
{
|
||||
return const_reverse_iterator (cend());
|
||||
}
|
||||
|
||||
reverse_iterator
|
||||
rend() noexcept
|
||||
{
|
||||
return reverse_iterator (begin());
|
||||
}
|
||||
|
||||
const_reverse_iterator
|
||||
rend() const noexcept
|
||||
{
|
||||
return const_reverse_iterator (cbegin());
|
||||
}
|
||||
|
||||
const_reverse_iterator
|
||||
crend() const noexcept
|
||||
{
|
||||
return const_reverse_iterator (cbegin());
|
||||
}
|
||||
|
||||
//
|
||||
// Capacity
|
||||
//
|
||||
|
||||
bool
|
||||
empty() const noexcept
|
||||
{
|
||||
return m_size == 0;
|
||||
}
|
||||
|
||||
size_type
|
||||
size() const noexcept
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
||||
size_type
|
||||
max_size() const noexcept
|
||||
{
|
||||
return size();
|
||||
}
|
||||
|
||||
size_type
|
||||
capacity() const noexcept
|
||||
{
|
||||
return size();
|
||||
}
|
||||
|
||||
//
|
||||
// Modifiers
|
||||
//
|
||||
|
||||
template <class U, class K>
|
||||
friend void swap (buffer_view <U, K>& lhs,
|
||||
buffer_view <U, K>& rhs) noexcept;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <class T, class Tag>
|
||||
inline
|
||||
bool
|
||||
operator== (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
|
||||
{
|
||||
return std::equal (
|
||||
lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend());
|
||||
}
|
||||
|
||||
template <class T, class Tag>
|
||||
inline
|
||||
bool
|
||||
operator!= (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
|
||||
{
|
||||
return ! (lhs == rhs);
|
||||
}
|
||||
|
||||
template <class T, class Tag>
|
||||
inline
|
||||
bool
|
||||
operator< (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
|
||||
{
|
||||
return std::lexicographical_compare (
|
||||
lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend());
|
||||
}
|
||||
|
||||
template <class T, class Tag>
|
||||
inline
|
||||
bool
|
||||
operator>= (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
|
||||
{
|
||||
return ! (lhs < rhs);
|
||||
}
|
||||
|
||||
template <class T, class Tag>
|
||||
inline
|
||||
bool
|
||||
operator> (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
|
||||
{
|
||||
return rhs < lhs;
|
||||
}
|
||||
|
||||
template <class T, class Tag>
|
||||
inline
|
||||
bool
|
||||
operator<= (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
|
||||
{
|
||||
return ! (rhs < lhs);
|
||||
}
|
||||
|
||||
template <class T, class Tag>
|
||||
inline
|
||||
void
|
||||
swap (buffer_view <T, Tag>& lhs, buffer_view <T, Tag>& rhs) noexcept
|
||||
{
|
||||
std::swap (lhs.m_base, rhs.m_base);
|
||||
std::swap (lhs.m_size, rhs.m_size);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
class T,
|
||||
class Tag = buffer_view_default_tag
|
||||
>
|
||||
using const_buffer_view = buffer_view <
|
||||
std::add_const_t <T>, Tag>;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -17,32 +17,38 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_UTILITY_ENABLEIF_H_INCLUDED
|
||||
#define BEAST_UTILITY_ENABLEIF_H_INCLUDED
|
||||
#ifndef BEAST_CONTAINER_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
|
||||
|
||||
#include "../type_traits/IntegralConstant.h"
|
||||
#include <type_traits>
|
||||
|
||||
namespace beast
|
||||
namespace beast {
|
||||
namespace detail {
|
||||
|
||||
// Extracts the key portion of value
|
||||
template <bool maybe_map>
|
||||
struct aged_associative_container_extract_t
|
||||
{
|
||||
template <class Value>
|
||||
decltype (Value::first) const&
|
||||
operator() (Value const& value) const
|
||||
{
|
||||
return value.first;
|
||||
}
|
||||
};
|
||||
|
||||
template <bool Enable, class T = void>
|
||||
struct EnableIfBool : TrueType { typedef T type; };
|
||||
|
||||
template <class T>
|
||||
struct EnableIfBool <false, T> : FalseType { };
|
||||
|
||||
template <class Cond, class T = void>
|
||||
struct EnableIf : public EnableIfBool <Cond::value, T> { };
|
||||
|
||||
template <bool Enable, class T = void>
|
||||
struct DisableIfBool : FalseType { typedef T type; };
|
||||
|
||||
template <class T>
|
||||
struct DisableIfBool <true, T> { };
|
||||
|
||||
template <class Cond, class T = void>
|
||||
struct DisableIf : public DisableIfBool <Cond::value, T> { };
|
||||
template <>
|
||||
struct aged_associative_container_extract_t <false>
|
||||
{
|
||||
template <class Value>
|
||||
Value const&
|
||||
operator() (Value const& value) const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
156
src/beast/beast/container/detail/aged_container_iterator.h
Normal file
156
src/beast/beast/container/detail/aged_container_iterator.h
Normal file
@@ -0,0 +1,156 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CONTAINER_AGED_CONTAINER_ITERATOR_H_INCLUDED
|
||||
#define BEAST_CONTAINER_AGED_CONTAINER_ITERATOR_H_INCLUDED
|
||||
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
|
||||
namespace beast {
|
||||
|
||||
template <bool, bool, class, class, class, class, class>
|
||||
class aged_ordered_container;
|
||||
|
||||
namespace detail {
|
||||
|
||||
// Idea for Base template argument to prevent having to repeat
|
||||
// the base class declaration comes from newbiz on ##c++/Freenode
|
||||
//
|
||||
// If Iterator is SCARY then this iterator will be as well.
|
||||
template <
|
||||
bool is_const,
|
||||
class Iterator,
|
||||
class Base =
|
||||
std::iterator <
|
||||
typename std::iterator_traits <Iterator>::iterator_category,
|
||||
typename std::conditional <is_const,
|
||||
typename Iterator::value_type::stashed::value_type const,
|
||||
typename Iterator::value_type::stashed::value_type>::type,
|
||||
typename std::iterator_traits <Iterator>::difference_type>
|
||||
>
|
||||
class aged_container_iterator
|
||||
: public Base
|
||||
{
|
||||
public:
|
||||
typedef typename Iterator::value_type::stashed::time_point time_point;
|
||||
|
||||
aged_container_iterator ()
|
||||
{
|
||||
}
|
||||
|
||||
template <class OtherIterator, class OtherBase>
|
||||
aged_container_iterator (aged_container_iterator <
|
||||
false, OtherIterator, OtherBase> const& other)
|
||||
: m_iter (other.m_iter)
|
||||
{
|
||||
}
|
||||
|
||||
template <bool other_is_const, class OtherIterator, class OtherBase>
|
||||
aged_container_iterator& operator= (aged_container_iterator <
|
||||
other_is_const, OtherIterator, OtherBase> const& other)
|
||||
{
|
||||
m_iter = other.m_iter;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <bool other_is_const, class OtherIterator, class OtherBase>
|
||||
bool operator== (aged_container_iterator <
|
||||
other_is_const, OtherIterator, OtherBase> const& other) const
|
||||
{
|
||||
return m_iter == other.m_iter;
|
||||
}
|
||||
|
||||
template <bool other_is_const, class OtherIterator, class OtherBase>
|
||||
bool operator!= (aged_container_iterator <
|
||||
other_is_const, OtherIterator, OtherBase> const& other) const
|
||||
{
|
||||
return m_iter != other.m_iter;
|
||||
}
|
||||
|
||||
aged_container_iterator& operator++ ()
|
||||
{
|
||||
++m_iter;
|
||||
return *this;
|
||||
}
|
||||
|
||||
aged_container_iterator operator++ (int)
|
||||
{
|
||||
aged_container_iterator const prev (*this);
|
||||
++m_iter;
|
||||
return prev;
|
||||
}
|
||||
|
||||
aged_container_iterator& operator-- ()
|
||||
{
|
||||
--m_iter;
|
||||
return *this;
|
||||
}
|
||||
|
||||
aged_container_iterator operator-- (int)
|
||||
{
|
||||
aged_container_iterator const prev (*this);
|
||||
--m_iter;
|
||||
return prev;
|
||||
}
|
||||
|
||||
typename Base::reference operator* () const
|
||||
{
|
||||
return m_iter->value;
|
||||
}
|
||||
|
||||
typename Base::pointer operator-> () const
|
||||
{
|
||||
return &m_iter->value;
|
||||
}
|
||||
|
||||
time_point const& when () const
|
||||
{
|
||||
return m_iter->when;
|
||||
}
|
||||
|
||||
private:
|
||||
template <bool, bool, class, class, class, class, class>
|
||||
friend class aged_ordered_container;
|
||||
|
||||
template <bool, bool, class, class, class, class, class, class>
|
||||
friend class aged_unordered_container;
|
||||
|
||||
template <bool, class, class>
|
||||
friend class aged_container_iterator;
|
||||
|
||||
template <class OtherIterator>
|
||||
aged_container_iterator (OtherIterator const& iter)
|
||||
: m_iter (iter)
|
||||
{
|
||||
}
|
||||
|
||||
Iterator const& iterator() const
|
||||
{
|
||||
return m_iter;
|
||||
}
|
||||
|
||||
Iterator m_iter;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
1926
src/beast/beast/container/detail/aged_ordered_container.h
Normal file
1926
src/beast/beast/container/detail/aged_ordered_container.h
Normal file
File diff suppressed because it is too large
Load Diff
2483
src/beast/beast/container/detail/aged_unordered_container.h
Normal file
2483
src/beast/beast/container/detail/aged_unordered_container.h
Normal file
File diff suppressed because it is too large
Load Diff
1460
src/beast/beast/container/impl/aged_associative_container.cpp
Normal file
1460
src/beast/beast/container/impl/aged_associative_container.cpp
Normal file
File diff suppressed because it is too large
Load Diff
323
src/beast/beast/container/tests/buffer_view.test.cpp
Normal file
323
src/beast/beast/container/tests/buffer_view.test.cpp
Normal file
@@ -0,0 +1,323 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
||||
#include "../buffer_view.h"
|
||||
|
||||
#include "../../cxx14/algorithm.h" // <algorithm>
|
||||
|
||||
namespace beast {
|
||||
|
||||
class buffer_view_Tests : public UnitTest
|
||||
{
|
||||
public:
|
||||
// Returns `true` if the iterator distance matches the size
|
||||
template <class FwdIt, class Size>
|
||||
static bool eq_dist (FwdIt first, FwdIt last, Size size)
|
||||
{
|
||||
auto const dist (std::distance (first, last));
|
||||
|
||||
static_assert (std::is_signed <decltype (dist)>::value,
|
||||
"dist must be signed");
|
||||
|
||||
if (dist < 0)
|
||||
return false;
|
||||
|
||||
return static_cast <Size> (dist) == size;
|
||||
}
|
||||
|
||||
// Check the contents of a buffer_view against the container
|
||||
template <class C, class T>
|
||||
void check (C const& c, buffer_view <T> v)
|
||||
{
|
||||
expect (! v.empty() || c.empty());
|
||||
expect (v.size() == c.size());
|
||||
expect (v.max_size() == v.size());
|
||||
expect (v.capacity() == v.size());
|
||||
|
||||
expect (eq_dist (v.begin(), v.end(), v.size()));
|
||||
expect (eq_dist (v.cbegin(), v.cend(), v.size()));
|
||||
expect (eq_dist (v.rbegin(), v.rend(), v.size()));
|
||||
expect (eq_dist (v.crbegin(), v.crend(), v.size()));
|
||||
|
||||
expect (std::equal (
|
||||
c.cbegin(), c.cend(), v.cbegin(), v.cend()));
|
||||
|
||||
expect (std::equal (
|
||||
c.crbegin(), c.crend(), v.crbegin(), v.crend()));
|
||||
|
||||
if (v.size() == c.size())
|
||||
{
|
||||
if (! v.empty())
|
||||
{
|
||||
expect (v.front() == c.front());
|
||||
expect (v.back() == c.back());
|
||||
}
|
||||
|
||||
for (std::size_t i (0); i < v.size(); ++i)
|
||||
expect (v[i] == c[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
// Call at() with an invalid index
|
||||
template <class V>
|
||||
void checkBadIndex (V& v,
|
||||
std::enable_if_t <
|
||||
std::is_const <typename V::value_type>::value>* = 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
v.at(0);
|
||||
fail();
|
||||
}
|
||||
catch (std::out_of_range e)
|
||||
{
|
||||
pass();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
// Call at() with an invalid index
|
||||
template <class V>
|
||||
void checkBadIndex (V& v,
|
||||
std::enable_if_t <
|
||||
! std::is_const <typename V::value_type>::value>* = 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
v.at(0);
|
||||
fail();
|
||||
}
|
||||
catch (std::out_of_range e)
|
||||
{
|
||||
pass();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
fail();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
v.at(0) = 1;
|
||||
fail();
|
||||
}
|
||||
catch (std::out_of_range e)
|
||||
{
|
||||
pass();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
// Checks invariants for an empty buffer_view
|
||||
template <class V>
|
||||
void checkEmpty (V& v)
|
||||
{
|
||||
expect (v.empty());
|
||||
expect (v.size() == 0);
|
||||
expect (v.max_size() == v.size());
|
||||
expect (v.capacity() == v.size());
|
||||
expect (v.begin() == v.end());
|
||||
expect (v.cbegin() == v.cend());
|
||||
expect (v.begin() == v.cend());
|
||||
expect (v.rbegin() == v.rend());
|
||||
expect (v.crbegin() == v.rend());
|
||||
|
||||
checkBadIndex (v);
|
||||
}
|
||||
|
||||
// Test empty containers
|
||||
void testEmpty()
|
||||
{
|
||||
beginTestCase ("empty");
|
||||
|
||||
buffer_view <char> v1;
|
||||
checkEmpty (v1);
|
||||
|
||||
buffer_view <char> v2;
|
||||
swap (v1, v2);
|
||||
checkEmpty (v1);
|
||||
checkEmpty (v2);
|
||||
|
||||
buffer_view <char const> v3 (v2);
|
||||
checkEmpty (v3);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
// Construct const views from a container
|
||||
template <class C>
|
||||
void testConstructConst (C const& c)
|
||||
{
|
||||
typedef buffer_view <std::add_const_t <
|
||||
typename C::value_type>> V;
|
||||
|
||||
{
|
||||
// construct from container
|
||||
V v (c);
|
||||
check (c, v);
|
||||
|
||||
// construct from buffer_view
|
||||
V v2 (v);
|
||||
check (c, v2);
|
||||
}
|
||||
|
||||
if (! c.empty())
|
||||
{
|
||||
{
|
||||
// construct from const pointer range
|
||||
V v (&c.front(), &c.back()+1);
|
||||
check (c, v);
|
||||
|
||||
// construct from pointer and size
|
||||
V v2 (&c.front(), c.size());
|
||||
check (v, v2);
|
||||
}
|
||||
|
||||
{
|
||||
// construct from non const pointer range
|
||||
C cp (c);
|
||||
V v (&cp.front(), &cp.back()+1);
|
||||
check (cp, v);
|
||||
|
||||
// construct from pointer and size
|
||||
V v2 (&cp.front(), cp.size());
|
||||
check (v, v2);
|
||||
|
||||
// construct from data and size
|
||||
V v3 (v2.data(), v2.size());
|
||||
check (c, v3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Construct view from a container
|
||||
template <class C>
|
||||
void testConstruct (C const& c)
|
||||
{
|
||||
static_assert (! std::is_const <typename C::value_type>::value,
|
||||
"Container value_type cannot be const");
|
||||
|
||||
testConstructConst (c);
|
||||
|
||||
typedef buffer_view <typename C::value_type> V;
|
||||
|
||||
C cp (c);
|
||||
V v (cp);
|
||||
check (cp, v);
|
||||
|
||||
std::reverse (v.begin(), v.end());
|
||||
check (cp, v);
|
||||
|
||||
expect (std::equal (v.rbegin(), v.rend(),
|
||||
c.begin(), c.end()));
|
||||
}
|
||||
|
||||
void testConstruct()
|
||||
{
|
||||
beginTestCase ("std::vector <char>");
|
||||
testConstruct (
|
||||
std::vector <char> ({'h', 'e', 'l', 'l', 'o'}));
|
||||
|
||||
beginTestCase ("std::string <char>");
|
||||
testConstruct (
|
||||
std::basic_string <char> ("hello"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void testCoerce()
|
||||
{
|
||||
beginTestCase ("coerce");
|
||||
|
||||
std::string const s ("hello");
|
||||
const_buffer_view <unsigned char> v (s);
|
||||
|
||||
pass();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void testAssign()
|
||||
{
|
||||
beginTestCase ("testAssign");
|
||||
std::vector <int> v1({1, 2, 3});
|
||||
buffer_view<int> r1(v1);
|
||||
std::vector <int> v2({4, 5, 6, 7});
|
||||
buffer_view<int> r2(v2);
|
||||
r1 = r2;
|
||||
expect (std::equal (r1.begin(), r1.end(), v2.begin(), v2.end()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
static_assert (std::is_constructible <buffer_view <int>,
|
||||
std::vector <int>&>::value, "");
|
||||
|
||||
static_assert (!std::is_constructible <buffer_view <int>,
|
||||
std::vector <int> const&>::value, "");
|
||||
|
||||
static_assert (std::is_constructible <buffer_view <int const>,
|
||||
std::vector <int>&>::value, "");
|
||||
|
||||
static_assert (std::is_constructible <buffer_view <int const>,
|
||||
std::vector <int> const&>::value, "");
|
||||
|
||||
static_assert (std::is_nothrow_default_constructible <
|
||||
buffer_view <int>>::value, "");
|
||||
|
||||
static_assert (std::is_nothrow_destructible <
|
||||
buffer_view <int>>::value, "");
|
||||
|
||||
static_assert (std::is_nothrow_copy_constructible <
|
||||
buffer_view <int>>::value, "");
|
||||
|
||||
static_assert (std::is_nothrow_copy_assignable <
|
||||
buffer_view<int>>::value, "");
|
||||
|
||||
static_assert (std::is_nothrow_move_constructible <
|
||||
buffer_view <int>>::value, "");
|
||||
|
||||
static_assert (std::is_nothrow_move_assignable <
|
||||
buffer_view <int>>::value, "");
|
||||
|
||||
void runTest()
|
||||
{
|
||||
testEmpty();
|
||||
testConstruct();
|
||||
testCoerce();
|
||||
testAssign();
|
||||
}
|
||||
|
||||
buffer_view_Tests() : UnitTest ("buffer_view", "beast")
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static buffer_view_Tests buffer_view_tests;
|
||||
|
||||
}
|
||||
@@ -22,7 +22,8 @@
|
||||
|
||||
#include "../Config.h"
|
||||
#include "../CStdInt.h"
|
||||
#include "../FixedArray.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -36,7 +37,7 @@ enum
|
||||
};
|
||||
|
||||
/** A container suitable for holding the resulting hash. */
|
||||
typedef FixedArray <uint8, digestLength> digest_type;
|
||||
typedef std::array <uint8, digestLength> digest_type;
|
||||
|
||||
namespace detail {
|
||||
struct Context
|
||||
@@ -85,7 +86,7 @@ public:
|
||||
|
||||
digest_type& finish (digest_type& digest)
|
||||
{
|
||||
finish (digest.c_array());
|
||||
finish (digest.data());
|
||||
return digest;
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
}
|
||||
*lhs++ = UInt (part);
|
||||
}
|
||||
bassert (carry == 0) // overflow
|
||||
bassert (carry == 0); // overflow
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ void* hash (void const* buffer, std::size_t bytes, void* digest)
|
||||
|
||||
digest_type& hash (void const* buffer, std::size_t bytes, digest_type& digest)
|
||||
{
|
||||
hash (buffer, bytes, digest.c_array());
|
||||
hash (buffer, bytes, digest.data());
|
||||
return digest;
|
||||
}
|
||||
|
||||
|
||||
90
src/beast/beast/cxx14/algorithm.h
Normal file
90
src/beast/beast/cxx14/algorithm.h
Normal file
@@ -0,0 +1,90 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CXX14_ALGORITHM_H_INCLUDED
|
||||
#define BEAST_CXX14_ALGORITHM_H_INCLUDED
|
||||
|
||||
#include "config.h"
|
||||
#include "functional.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace std {
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <class Pred, class FwdIt1, class FwdIt2>
|
||||
bool equal (FwdIt1 first1, FwdIt1 last1,
|
||||
FwdIt2 first2, FwdIt2 last2, Pred pred,
|
||||
std::input_iterator_tag, std::input_iterator_tag)
|
||||
{
|
||||
for (; first1 != last1 && first2 != last2; ++first1, ++first2)
|
||||
if (! pred (*first1, *first2))
|
||||
return false;
|
||||
return first1 == last1 && first2 == last2;
|
||||
}
|
||||
|
||||
template <class Pred, class RanIt1, class RanIt2>
|
||||
bool equal (RanIt1 first1, RanIt1 last1,
|
||||
RanIt2 first2, RanIt2 last2, Pred pred,
|
||||
random_access_iterator_tag,
|
||||
random_access_iterator_tag )
|
||||
{
|
||||
if (std::distance (first1, last1) !=
|
||||
std::distance (first2, last2))
|
||||
return false;
|
||||
for (; first1 != last1; ++first1, ++first2)
|
||||
if (! pred (*first1, *first2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** C++14 implementation of std::equal. */
|
||||
/** @{ */
|
||||
template <class FwdIt1, class FwdIt2>
|
||||
bool equal (FwdIt1 first1, FwdIt1 last1,
|
||||
FwdIt2 first2, FwdIt2 last2)
|
||||
{
|
||||
return std::detail::equal (first1, last1,
|
||||
first2, last2, std::equal_to <void>(),
|
||||
typename std::iterator_traits <
|
||||
FwdIt1>::iterator_category(),
|
||||
typename std::iterator_traits <
|
||||
FwdIt2>::iterator_category());
|
||||
}
|
||||
|
||||
template <class FwdIt1, class FwdIt2, class Pred>
|
||||
bool equal (FwdIt1 first1, FwdIt1 last1,
|
||||
FwdIt2 first2, FwdIt2 last2, Pred pred)
|
||||
{
|
||||
return std::detail::equal <
|
||||
typename std::add_lvalue_reference <Pred>::type> (
|
||||
first1, last1, first2, last2, pred,
|
||||
typename std::iterator_traits <
|
||||
FwdIt1>::iterator_category(),
|
||||
typename std::iterator_traits <
|
||||
FwdIt2>::iterator_category());
|
||||
}
|
||||
/** @} */
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
44
src/beast/beast/cxx14/config.h
Normal file
44
src/beast/beast/cxx14/config.h
Normal file
@@ -0,0 +1,44 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CXX14_CONFIG_H_INCLUDED
|
||||
#define BEAST_CXX14_CONFIG_H_INCLUDED
|
||||
|
||||
// Sets C++14 compatibility configuration macros based on build environment
|
||||
|
||||
// Disables beast c++14 compatibility additions when set to 1
|
||||
//
|
||||
#ifndef BEAST_NO_CXX14_COMPATIBILITY
|
||||
# ifdef _MSC_VER
|
||||
# define BEAST_NO_CXX14_COMPATIBILITY 1
|
||||
# else
|
||||
# define BEAST_NO_CXX14_COMPATIBILITY 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Disables beast's make_unique
|
||||
#ifndef BEAST_NO_CXX14_MAKE_UNIQUE
|
||||
# ifdef _MSC_VER
|
||||
# define BEAST_NO_CXX14_MAKE_UNIQUE 1
|
||||
# else
|
||||
# define BEAST_NO_CXX14_MAKE_UNIQUE 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -17,6 +17,4 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "shared_ptr.h"
|
||||
#include "tests/integer_sequence.test.cpp"
|
||||
53
src/beast/beast/cxx14/functional.h
Normal file
53
src/beast/beast/cxx14/functional.h
Normal file
@@ -0,0 +1,53 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CXX14_FUNCTIONAL_H_INCLUDED
|
||||
#define BEAST_CXX14_FUNCTIONAL_H_INCLUDED
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#if ! BEAST_NO_CXX14_COMPATIBILITY
|
||||
|
||||
namespace std {
|
||||
|
||||
// C++14 implementation of std::equal_to <void> specialization.
|
||||
// This supports heterogeneous comparisons.
|
||||
template <>
|
||||
struct equal_to <void>
|
||||
{
|
||||
// VFALCO NOTE Its not clear how to support is_transparent pre c++14
|
||||
typedef std::true_type is_transparent;
|
||||
|
||||
template <class T, class U>
|
||||
auto operator() (T&& lhs, U&& rhs) const ->
|
||||
decltype (std::forward <T> (lhs) == std::forward <U> (rhs))
|
||||
{
|
||||
return std::forward <T> (lhs) == std::forward <U> (rhs);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
39
src/beast/beast/cxx14/memory.h
Normal file
39
src/beast/beast/cxx14/memory.h
Normal file
@@ -0,0 +1,39 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CXX14_MEMORY_H_INCLUDED
|
||||
#define BEAST_CXX14_MEMORY_H_INCLUDED
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace std {
|
||||
|
||||
#if ! BEAST_NO_CXX14_MAKE_UNIQUE
|
||||
template <class T, class... Args>
|
||||
std::unique_ptr <T> make_unique (Args&&... args)
|
||||
{
|
||||
return std::unique_ptr <T> (new T (std::forward <Args> (args)...));
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
113
src/beast/beast/cxx14/tests/integer_sequence.test.cpp
Normal file
113
src/beast/beast/cxx14/tests/integer_sequence.test.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "../utility.h"
|
||||
|
||||
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
class integer_sequence_Tests : public UnitTest
|
||||
{
|
||||
public:
|
||||
template <class AtContainer, class T, T... I>
|
||||
static
|
||||
auto
|
||||
extract (AtContainer const& t,
|
||||
std::integer_sequence <T, I...>) ->
|
||||
decltype (std::make_tuple (std::get <I> (t)...))
|
||||
{
|
||||
return std::make_tuple (std::get <I> (t)...);
|
||||
}
|
||||
|
||||
void runTest()
|
||||
{
|
||||
beginTestCase ("call");
|
||||
|
||||
// Code from
|
||||
// http://llvm.org/svn/llvm-project/libcxx/trunk/test/utilities/intseq/intseq.general/integer_seq.pass.cpp
|
||||
|
||||
// Make a couple of sequences
|
||||
using int3 = std::make_integer_sequence<int, 3>; // generates int: 0,1,2
|
||||
using size7 = std::make_integer_sequence<size_t, 7>; // generates size_t: 0,1,2,3,4,5,6
|
||||
using size4 = std::make_index_sequence<4>; // generates size_t: 0,1,2,3
|
||||
using size2 = std::index_sequence_for<int, size_t>; // generates size_t: 0,1
|
||||
using intmix = std::integer_sequence<int, 9, 8, 7, 2>; // generates int: 9,8,7,2
|
||||
using sizemix = std::index_sequence<1, 1, 2, 3, 5>; // generates size_t: 1,1,2,3,5
|
||||
|
||||
// Make sure they're what we expect
|
||||
static_assert ( std::is_same <int3::value_type, int>::value, "int3 type wrong" );
|
||||
static_assert ( int3::static_size == 3, "int3 size wrong" );
|
||||
|
||||
static_assert ( std::is_same <size7::value_type, size_t>::value, "size7 type wrong" );
|
||||
static_assert ( size7::static_size == 7, "size7 size wrong" );
|
||||
|
||||
static_assert ( std::is_same <size4::value_type, size_t>::value, "size4 type wrong" );
|
||||
static_assert ( size4::static_size == 4, "size4 size wrong" );
|
||||
|
||||
static_assert ( std::is_same <size2::value_type, size_t>::value, "size2 type wrong" );
|
||||
static_assert ( size2::static_size == 2, "size2 size wrong" );
|
||||
|
||||
static_assert ( std::is_same <intmix::value_type, int>::value, "intmix type wrong" );
|
||||
static_assert ( intmix::static_size == 4, "intmix size wrong" );
|
||||
|
||||
static_assert ( std::is_same <sizemix::value_type, size_t>::value, "sizemix type wrong" );
|
||||
static_assert ( sizemix::static_size == 5, "sizemix size wrong" );
|
||||
|
||||
auto tup = std::make_tuple ( 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 );
|
||||
|
||||
// Use them
|
||||
auto t3 = extract ( tup, int3() );
|
||||
static_assert ( std::tuple_size<decltype(t3)>::value == int3::static_size, "t3 size wrong");
|
||||
expect ( t3 == std::make_tuple ( 10, 11, 12 ));
|
||||
|
||||
auto t7 = extract ( tup, size7 ());
|
||||
static_assert ( std::tuple_size<decltype(t7)>::value == size7::static_size, "t7 size wrong");
|
||||
expect ( t7 == std::make_tuple ( 10, 11, 12, 13, 14, 15, 16 ));
|
||||
|
||||
auto t4 = extract ( tup, size4 ());
|
||||
static_assert ( std::tuple_size<decltype(t4)>::value == size4::static_size, "t4 size wrong");
|
||||
expect ( t4 == std::make_tuple ( 10, 11, 12, 13 ));
|
||||
|
||||
auto t2 = extract ( tup, size2 ());
|
||||
static_assert ( std::tuple_size<decltype(t2)>::value == size2::static_size, "t2 size wrong");
|
||||
expect ( t2 == std::make_tuple ( 10, 11 ));
|
||||
|
||||
auto tintmix = extract ( tup, intmix ());
|
||||
static_assert ( std::tuple_size<decltype(tintmix)>::value == intmix::static_size, "tintmix size wrong");
|
||||
expect ( tintmix == std::make_tuple ( 19, 18, 17, 12 ));
|
||||
|
||||
auto tsizemix = extract ( tup, sizemix ());
|
||||
static_assert ( std::tuple_size<decltype(tsizemix)>::value == sizemix::static_size, "tsizemix size wrong");
|
||||
expect ( tsizemix == std::make_tuple ( 11, 11, 12, 13, 15 ));
|
||||
pass();
|
||||
}
|
||||
|
||||
integer_sequence_Tests() : UnitTest ("integer_sequence", "beast")
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static integer_sequence_Tests integer_sequence_tests;
|
||||
|
||||
}
|
||||
}
|
||||
147
src/beast/beast/cxx14/type_traits.h
Normal file
147
src/beast/beast/cxx14/type_traits.h
Normal file
@@ -0,0 +1,147 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CXX14_TYPE_TRAITS_H_INCLUDED
|
||||
#define BEAST_CXX14_TYPE_TRAITS_H_INCLUDED
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace std {
|
||||
|
||||
// Ideas from Howard Hinnant
|
||||
//
|
||||
// Specializations of is_constructible for pair and tuple which
|
||||
// work around an apparent defect in the standard that causes well
|
||||
// formed expressions involving pairs or tuples of non default-constructible
|
||||
// types to generate compile errors.
|
||||
//
|
||||
template <class T, class U>
|
||||
struct is_constructible <pair <T, U>>
|
||||
: integral_constant <bool,
|
||||
is_default_constructible <T>::value &&
|
||||
is_default_constructible <U>::value>
|
||||
{
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <bool...>
|
||||
struct compile_time_all;
|
||||
|
||||
template <>
|
||||
struct compile_time_all <>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template <bool Arg0, bool ... Argn>
|
||||
struct compile_time_all <Arg0, Argn...>
|
||||
{
|
||||
static const bool value =
|
||||
Arg0 && compile_time_all <Argn...>::value;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template <class ...T>
|
||||
struct is_constructible <tuple <T...>>
|
||||
: integral_constant <bool,
|
||||
detail::compile_time_all <
|
||||
is_default_constructible <T>::value...>::value>
|
||||
{
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if ! BEAST_NO_CXX14_COMPATIBILITY
|
||||
|
||||
// From http://llvm.org/svn/llvm-project/libcxx/trunk/include/type_traits
|
||||
|
||||
// const-volatile modifications:
|
||||
template <class T>
|
||||
using remove_const_t = typename remove_const<T>::type; // C++14
|
||||
template <class T>
|
||||
using remove_volatile_t = typename remove_volatile<T>::type; // C++14
|
||||
template <class T>
|
||||
using remove_cv_t = typename remove_cv<T>::type; // C++14
|
||||
template <class T>
|
||||
using add_const_t = typename add_const<T>::type; // C++14
|
||||
template <class T>
|
||||
using add_volatile_t = typename add_volatile<T>::type; // C++14
|
||||
template <class T>
|
||||
using add_cv_t = typename add_cv<T>::type; // C++14
|
||||
|
||||
// reference modifications:
|
||||
template <class T>
|
||||
using remove_reference_t = typename remove_reference<T>::type; // C++14
|
||||
template <class T>
|
||||
using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; // C++14
|
||||
template <class T>
|
||||
using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; // C++14
|
||||
|
||||
// sign modifications:
|
||||
template <class T>
|
||||
using make_signed_t = typename make_signed<T>::type; // C++14
|
||||
template <class T>
|
||||
using make_unsigned_t = typename make_unsigned<T>::type; // C++14
|
||||
|
||||
// array modifications:
|
||||
template <class T>
|
||||
using remove_extent_t = typename remove_extent<T>::type; // C++14
|
||||
template <class T>
|
||||
using remove_all_extents_t = typename remove_all_extents<T>::type; // C++14
|
||||
|
||||
// pointer modifications:
|
||||
template <class T>
|
||||
using remove_pointer_t = typename remove_pointer<T>::type; // C++14
|
||||
template <class T>
|
||||
using add_pointer_t = typename add_pointer<T>::type; // C++14
|
||||
|
||||
// other transformations:
|
||||
|
||||
#if 0
|
||||
// This is not easy to implement in C++11
|
||||
template <size_t Len, std::size_t Align=std::alignment_of<max_align_t>::value>
|
||||
using aligned_storage_t = typename aligned_storage<Len,Align>::type; // C++14
|
||||
template <std::size_t Len, class... Types>
|
||||
using aligned_union_t = typename aligned_union<Len,Types...>::type; // C++14
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
using decay_t = typename decay<T>::type; // C++14
|
||||
template <bool b, class T=void>
|
||||
using enable_if_t = typename enable_if<b,T>::type; // C++14
|
||||
template <bool b, class T, class F>
|
||||
using conditional_t = typename conditional<b,T,F>::type; // C++14
|
||||
template <class... T>
|
||||
using common_type_t = typename common_type<T...>::type; // C++14
|
||||
template <class T>
|
||||
using underlying_type_t = typename underlying_type<T>::type; // C++14
|
||||
template <class F, class... ArgTypes>
|
||||
using result_of_t = typename result_of<F(ArgTypes...)>::type; // C++14
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
169
src/beast/beast/cxx14/utility.h
Normal file
169
src/beast/beast/cxx14/utility.h
Normal file
@@ -0,0 +1,169 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_CXX14_UTILITY_H_INCLUDED
|
||||
#define BEAST_CXX14_UTILITY_H_INCLUDED
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace std {
|
||||
|
||||
template <class T, T... Ints>
|
||||
struct integer_sequence
|
||||
{
|
||||
typedef T value_type;
|
||||
static_assert (is_integral<T>::value,
|
||||
"std::integer_sequence can only be instantiated with an integral type" );
|
||||
|
||||
static const size_t static_size = sizeof...(Ints);
|
||||
|
||||
static /* constexpr */ size_t size() /* noexcept */
|
||||
{
|
||||
return sizeof...(Ints);
|
||||
}
|
||||
};
|
||||
|
||||
template <size_t... Ints>
|
||||
using index_sequence = integer_sequence <size_t, Ints...>;
|
||||
|
||||
namespace detail {
|
||||
|
||||
// This workaround is needed for msvc broken sizeof...
|
||||
template <class... Args>
|
||||
struct sizeof_workaround
|
||||
{
|
||||
static size_t const size = sizeof... (Args);
|
||||
};
|
||||
|
||||
} // detail
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
// This implementation compiles on MSVC and clang but not gcc
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <class T, unsigned long long N, class Seq>
|
||||
struct make_integer_sequence_unchecked;
|
||||
|
||||
template <class T, unsigned long long N, unsigned long long ...Indices>
|
||||
struct make_integer_sequence_unchecked <
|
||||
T, N, integer_sequence <T, Indices...>>
|
||||
{
|
||||
typedef typename make_integer_sequence_unchecked<
|
||||
T, N-1, integer_sequence<T, N-1, Indices...>>::type type;
|
||||
};
|
||||
|
||||
template <class T, unsigned long long ...Indices>
|
||||
struct make_integer_sequence_unchecked <
|
||||
T, 0, integer_sequence<T, Indices...>>
|
||||
{
|
||||
typedef integer_sequence <T, Indices...> type;
|
||||
};
|
||||
|
||||
template <class T, T N>
|
||||
struct make_integer_sequence_checked
|
||||
{
|
||||
static_assert (is_integral <T>::value,
|
||||
"T must be an integral type");
|
||||
|
||||
static_assert (N >= 0,
|
||||
"N must be non-negative");
|
||||
|
||||
typedef typename make_integer_sequence_unchecked <
|
||||
T, N, integer_sequence<T>>::type type;
|
||||
};
|
||||
|
||||
} // detail
|
||||
|
||||
template <class T, T N>
|
||||
using make_integer_sequence =
|
||||
typename detail::make_integer_sequence_checked <T, N>::type;
|
||||
|
||||
template <size_t N>
|
||||
using make_index_sequence = make_integer_sequence <size_t, N>;
|
||||
|
||||
template <class... Args>
|
||||
using index_sequence_for =
|
||||
make_index_sequence <detail::sizeof_workaround <Args...>::size>;
|
||||
|
||||
#else
|
||||
|
||||
// This implementation compiles on gcc but not MSVC
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <size_t... Ints>
|
||||
struct index_tuple
|
||||
{
|
||||
typedef index_tuple <Ints..., sizeof... (Ints)> next;
|
||||
|
||||
};
|
||||
|
||||
template <size_t N>
|
||||
struct build_index_tuple
|
||||
{
|
||||
typedef typename build_index_tuple <N-1>::type::next type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct build_index_tuple <0>
|
||||
{
|
||||
typedef index_tuple<> type;
|
||||
};
|
||||
|
||||
template <class T, T N,
|
||||
class Seq = typename build_index_tuple <N>::type
|
||||
>
|
||||
struct make_integer_sequence;
|
||||
|
||||
template <class T, T N, size_t... Ints>
|
||||
struct make_integer_sequence <T, N, index_tuple <Ints...>>
|
||||
{
|
||||
static_assert (is_integral <T>::value,
|
||||
"T must be an integral type");
|
||||
|
||||
static_assert (N >= 0,
|
||||
"N must be non-negative");
|
||||
|
||||
typedef integer_sequence <T, static_cast <T> (Ints)...> type;
|
||||
};
|
||||
|
||||
} // detail
|
||||
|
||||
template <class T, T N>
|
||||
using make_integer_sequence =
|
||||
typename detail::make_integer_sequence <T, N>::type;
|
||||
|
||||
template <size_t N>
|
||||
using make_index_sequence = make_integer_sequence <size_t, N>;
|
||||
|
||||
template <class... Args>
|
||||
using index_sequence_for =
|
||||
make_index_sequence <detail::sizeof_workaround <Args...>::size>;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -130,9 +130,6 @@ extern std::size_t hash_value (beast::URL const& url);
|
||||
|
||||
namespace std {
|
||||
|
||||
template <typename T>
|
||||
struct hash;
|
||||
|
||||
template <>
|
||||
struct hash <beast::URL>
|
||||
{
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
#include "../ParsedURL.h"
|
||||
|
||||
#include "http-parser/http_parser.h"
|
||||
|
||||
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
||||
|
||||
#include "http_parser.h"
|
||||
|
||||
namespace beast {
|
||||
|
||||
ParsedURL::ParsedURL ()
|
||||
|
||||
13
src/beast/beast/http/impl/http-parser/.gitignore
vendored
13
src/beast/beast/http/impl/http-parser/.gitignore
vendored
@@ -12,3 +12,16 @@ parsertrace_g
|
||||
*.Makefile
|
||||
*.so.*
|
||||
*.a
|
||||
|
||||
|
||||
# Visual Studio uglies
|
||||
*.suo
|
||||
*.sln
|
||||
*.vcxproj
|
||||
*.vcxproj.filters
|
||||
*.vcxproj.user
|
||||
*.opensdf
|
||||
*.ncrunchsolution*
|
||||
*.sdf
|
||||
*.vsp
|
||||
*.psess
|
||||
|
||||
@@ -39,3 +39,11 @@ BogDan Vatra <bogdan@kde.org>
|
||||
Peter Faiman <peter@thepicard.org>
|
||||
Corey Richardson <corey@octayn.net>
|
||||
Tóth Tamás <tomika_nospam@freemail.hu>
|
||||
Patrik Stutz <patrik.stutz@gmail.com>
|
||||
Cam Swords <cam.swords@gmail.com>
|
||||
Chris Dickinson <christopher.s.dickinson@gmail.com>
|
||||
Uli Köhler <ukoehler@btronik.de>
|
||||
Charlie Somerville <charlie@charliesomerville.com>
|
||||
Fedor Indutny <fedor.indutny@gmail.com>
|
||||
runner <runner.mei@gmail.com>
|
||||
Alexis Campailla <alexis@janeasystems.com>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
|
||||
SONAME ?= libhttp_parser.so.2.1
|
||||
SONAME ?= libhttp_parser.so.2.2.1
|
||||
|
||||
CC?=gcc
|
||||
AR?=ar
|
||||
|
||||
@@ -36,38 +36,41 @@ Usage
|
||||
One `http_parser` object is used per TCP connection. Initialize the struct
|
||||
using `http_parser_init()` and set the callbacks. That might look something
|
||||
like this for a request parser:
|
||||
```c
|
||||
http_parser_settings settings;
|
||||
settings.on_url = my_url_callback;
|
||||
settings.on_header_field = my_header_field_callback;
|
||||
/* ... */
|
||||
|
||||
http_parser_settings settings;
|
||||
settings.on_url = my_url_callback;
|
||||
settings.on_header_field = my_header_field_callback;
|
||||
/* ... */
|
||||
|
||||
http_parser *parser = malloc(sizeof(http_parser));
|
||||
http_parser_init(parser, HTTP_REQUEST);
|
||||
parser->data = my_socket;
|
||||
http_parser *parser = malloc(sizeof(http_parser));
|
||||
http_parser_init(parser, HTTP_REQUEST);
|
||||
parser->data = my_socket;
|
||||
```
|
||||
|
||||
When data is received on the socket execute the parser and check for errors.
|
||||
|
||||
size_t len = 80*1024, nparsed;
|
||||
char buf[len];
|
||||
ssize_t recved;
|
||||
```c
|
||||
size_t len = 80*1024, nparsed;
|
||||
char buf[len];
|
||||
ssize_t recved;
|
||||
|
||||
recved = recv(fd, buf, len, 0);
|
||||
recved = recv(fd, buf, len, 0);
|
||||
|
||||
if (recved < 0) {
|
||||
/* Handle error. */
|
||||
}
|
||||
if (recved < 0) {
|
||||
/* Handle error. */
|
||||
}
|
||||
|
||||
/* Start up / continue the parser.
|
||||
* Note we pass recved==0 to signal that EOF has been recieved.
|
||||
*/
|
||||
nparsed = http_parser_execute(parser, &settings, buf, recved);
|
||||
/* Start up / continue the parser.
|
||||
* Note we pass recved==0 to signal that EOF has been recieved.
|
||||
*/
|
||||
nparsed = http_parser_execute(parser, &settings, buf, recved);
|
||||
|
||||
if (parser->upgrade) {
|
||||
/* handle new protocol */
|
||||
} else if (nparsed != recved) {
|
||||
/* Handle error. Usually just close the connection. */
|
||||
}
|
||||
if (parser->upgrade) {
|
||||
/* handle new protocol */
|
||||
} else if (nparsed != recved) {
|
||||
/* Handle error. Usually just close the connection. */
|
||||
}
|
||||
```
|
||||
|
||||
HTTP needs to know where the end of the stream is. For example, sometimes
|
||||
servers send responses without Content-Length and expect the client to
|
||||
|
||||
@@ -248,6 +248,7 @@ enum state
|
||||
, s_res_http_minor
|
||||
, s_res_first_status_code
|
||||
, s_res_status_code
|
||||
, s_res_status_start
|
||||
, s_res_status
|
||||
, s_res_line_almost_done
|
||||
|
||||
@@ -581,6 +582,7 @@ size_t http_parser_execute (http_parser *parser,
|
||||
const char *header_value_mark = 0;
|
||||
const char *url_mark = 0;
|
||||
const char *body_mark = 0;
|
||||
const char *status_mark = 0;
|
||||
|
||||
/* We're in an error state. Don't bother doing anything. */
|
||||
if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
|
||||
@@ -627,6 +629,9 @@ size_t http_parser_execute (http_parser *parser,
|
||||
case s_req_fragment:
|
||||
url_mark = data;
|
||||
break;
|
||||
case s_res_status:
|
||||
status_mark = data;
|
||||
break;
|
||||
}
|
||||
|
||||
for (p=data; p != data + len; p++) {
|
||||
@@ -634,7 +639,17 @@ size_t http_parser_execute (http_parser *parser,
|
||||
|
||||
if (PARSING_HEADER(parser->state)) {
|
||||
++parser->nread;
|
||||
/* Buffer overflow attack */
|
||||
/* Don't allow the total size of the HTTP headers (including the status
|
||||
* line) to exceed HTTP_MAX_HEADER_SIZE. This check is here to protect
|
||||
* embedders against denial-of-service attacks where the attacker feeds
|
||||
* us a never-ending header that the embedder keeps buffering.
|
||||
*
|
||||
* This check is arguably the responsibility of embedders but we're doing
|
||||
* it on the embedder's behalf because most won't bother and this way we
|
||||
* make the web a little safer. HTTP_MAX_HEADER_SIZE is still far bigger
|
||||
* than any reasonable request or response so this should never affect
|
||||
* day-to-day operation.
|
||||
*/
|
||||
if (parser->nread > HTTP_MAX_HEADER_SIZE) {
|
||||
SET_ERRNO(HPE_HEADER_OVERFLOW);
|
||||
goto error;
|
||||
@@ -823,7 +838,7 @@ size_t http_parser_execute (http_parser *parser,
|
||||
if (!IS_NUM(ch)) {
|
||||
switch (ch) {
|
||||
case ' ':
|
||||
parser->state = s_res_status;
|
||||
parser->state = s_res_status_start;
|
||||
break;
|
||||
case CR:
|
||||
parser->state = s_res_line_almost_done;
|
||||
@@ -849,9 +864,8 @@ size_t http_parser_execute (http_parser *parser,
|
||||
break;
|
||||
}
|
||||
|
||||
case s_res_status:
|
||||
/* the human readable status. e.g. "NOT FOUND"
|
||||
* we are not humans so just ignore this */
|
||||
case s_res_status_start:
|
||||
{
|
||||
if (ch == CR) {
|
||||
parser->state = s_res_line_almost_done;
|
||||
break;
|
||||
@@ -861,12 +875,31 @@ size_t http_parser_execute (http_parser *parser,
|
||||
parser->state = s_header_field_start;
|
||||
break;
|
||||
}
|
||||
|
||||
MARK(status);
|
||||
parser->state = s_res_status;
|
||||
parser->index = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case s_res_status:
|
||||
if (ch == CR) {
|
||||
parser->state = s_res_line_almost_done;
|
||||
CALLBACK_DATA(status);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ch == LF) {
|
||||
parser->state = s_header_field_start;
|
||||
CALLBACK_DATA(status);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case s_res_line_almost_done:
|
||||
STRICT_CHECK(ch != LF);
|
||||
parser->state = s_header_field_start;
|
||||
CALLBACK_NOTIFY(status_complete);
|
||||
break;
|
||||
|
||||
case s_start_req:
|
||||
@@ -1476,8 +1509,8 @@ size_t http_parser_execute (http_parser *parser,
|
||||
t *= 10;
|
||||
t += ch - '0';
|
||||
|
||||
/* Overflow? */
|
||||
if (t < parser->content_length || t == ULLONG_MAX) {
|
||||
/* Overflow? Test against a conservative limit for simplicity. */
|
||||
if ((ULLONG_MAX - 10) / 10 < parser->content_length) {
|
||||
SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
|
||||
goto error;
|
||||
}
|
||||
@@ -1749,8 +1782,8 @@ size_t http_parser_execute (http_parser *parser,
|
||||
t *= 16;
|
||||
t += unhex_val;
|
||||
|
||||
/* Overflow? */
|
||||
if (t < parser->content_length || t == ULLONG_MAX) {
|
||||
/* Overflow? Test against a conservative limit for simplicity. */
|
||||
if ((ULLONG_MAX - 16) / 16 < parser->content_length) {
|
||||
SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
|
||||
goto error;
|
||||
}
|
||||
@@ -1844,12 +1877,14 @@ size_t http_parser_execute (http_parser *parser,
|
||||
assert(((header_field_mark ? 1 : 0) +
|
||||
(header_value_mark ? 1 : 0) +
|
||||
(url_mark ? 1 : 0) +
|
||||
(body_mark ? 1 : 0)) <= 1);
|
||||
(body_mark ? 1 : 0) +
|
||||
(status_mark ? 1 : 0)) <= 1);
|
||||
|
||||
CALLBACK_DATA_NOADVANCE(header_field);
|
||||
CALLBACK_DATA_NOADVANCE(header_value);
|
||||
CALLBACK_DATA_NOADVANCE(url);
|
||||
CALLBACK_DATA_NOADVANCE(body);
|
||||
CALLBACK_DATA_NOADVANCE(status);
|
||||
|
||||
return len;
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ extern "C" {
|
||||
|
||||
/* Also update SONAME in the Makefile whenever you change these. */
|
||||
#define HTTP_PARSER_VERSION_MAJOR 2
|
||||
#define HTTP_PARSER_VERSION_MINOR 1
|
||||
#define HTTP_PARSER_VERSION_PATCH 0
|
||||
#define HTTP_PARSER_VERSION_MINOR 2
|
||||
#define HTTP_PARSER_VERSION_PATCH 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
|
||||
@@ -143,13 +143,13 @@ enum flags
|
||||
\
|
||||
/* Callback-related errors */ \
|
||||
XX(CB_message_begin, "the on_message_begin callback failed") \
|
||||
XX(CB_status_complete, "the on_status_complete callback failed") \
|
||||
XX(CB_url, "the on_url callback failed") \
|
||||
XX(CB_header_field, "the on_header_field callback failed") \
|
||||
XX(CB_header_value, "the on_header_value callback failed") \
|
||||
XX(CB_headers_complete, "the on_headers_complete callback failed") \
|
||||
XX(CB_body, "the on_body callback failed") \
|
||||
XX(CB_message_complete, "the on_message_complete callback failed") \
|
||||
XX(CB_status, "the on_status callback failed") \
|
||||
\
|
||||
/* Parsing-related errors */ \
|
||||
XX(INVALID_EOF_STATE, "stream ended at an unexpected time") \
|
||||
@@ -193,11 +193,11 @@ enum http_errno {
|
||||
|
||||
struct http_parser {
|
||||
/** PRIVATE **/
|
||||
unsigned char type : 2; /* enum http_parser_type */
|
||||
unsigned char flags : 6; /* F_* values from 'flags' enum; semi-public */
|
||||
unsigned char state; /* enum state from http_parser.c */
|
||||
unsigned char header_state; /* enum header_state from http_parser.c */
|
||||
unsigned char index; /* index into current matcher */
|
||||
unsigned int type : 2; /* enum http_parser_type */
|
||||
unsigned int flags : 6; /* F_* values from 'flags' enum; semi-public */
|
||||
unsigned int state : 8; /* enum state from http_parser.c */
|
||||
unsigned int header_state : 8; /* enum header_state from http_parser.c */
|
||||
unsigned int index : 8; /* index into current matcher */
|
||||
|
||||
uint32_t nread; /* # bytes read in various scenarios */
|
||||
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
|
||||
@@ -205,16 +205,16 @@ struct http_parser {
|
||||
/** READ-ONLY **/
|
||||
unsigned short http_major;
|
||||
unsigned short http_minor;
|
||||
unsigned short status_code; /* responses only */
|
||||
unsigned char method; /* requests only */
|
||||
unsigned char http_errno : 7;
|
||||
unsigned int status_code : 16; /* responses only */
|
||||
unsigned int method : 8; /* requests only */
|
||||
unsigned int http_errno : 7;
|
||||
|
||||
/* 1 = Upgrade header was present and the parser has exited because of that.
|
||||
* 0 = No upgrade header present.
|
||||
* Should be checked when http_parser_execute() returns in addition to
|
||||
* error checking.
|
||||
*/
|
||||
unsigned char upgrade : 1;
|
||||
unsigned int upgrade : 1;
|
||||
|
||||
/** PUBLIC **/
|
||||
void *data; /* A pointer to get hook to the "connection" or "socket" object */
|
||||
@@ -224,7 +224,7 @@ struct http_parser {
|
||||
struct http_parser_settings {
|
||||
http_cb on_message_begin;
|
||||
http_data_cb on_url;
|
||||
http_cb on_status_complete;
|
||||
http_data_cb on_status;
|
||||
http_data_cb on_header_field;
|
||||
http_data_cb on_header_value;
|
||||
http_cb on_headers_complete;
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
# undef strlcat
|
||||
# undef strlncpy
|
||||
# undef strlcpy
|
||||
#endif /* defined(__APPLE__) */
|
||||
|
||||
#undef TRUE
|
||||
#define TRUE 1
|
||||
#undef FALSE
|
||||
@@ -44,6 +50,7 @@ struct message {
|
||||
enum http_parser_type type;
|
||||
enum http_method method;
|
||||
int status_code;
|
||||
char response_status[MAX_ELEMENT_SIZE];
|
||||
char request_path[MAX_ELEMENT_SIZE];
|
||||
char request_url[MAX_ELEMENT_SIZE];
|
||||
char fragment[MAX_ELEMENT_SIZE];
|
||||
@@ -927,6 +934,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 301
|
||||
,.response_status= "Moved Permanently"
|
||||
,.num_headers= 8
|
||||
,.headers=
|
||||
{ { "Location", "http://www.google.com/" }
|
||||
@@ -975,6 +983,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 5
|
||||
,.headers=
|
||||
{ { "Date", "Tue, 04 Aug 2009 07:59:32 GMT" }
|
||||
@@ -1003,6 +1012,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 404
|
||||
,.response_status= "Not Found"
|
||||
,.num_headers= 0
|
||||
,.headers= {}
|
||||
,.body_size= 0
|
||||
@@ -1018,6 +1028,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 301
|
||||
,.response_status= ""
|
||||
,.num_headers= 0
|
||||
,.headers= {}
|
||||
,.body= ""
|
||||
@@ -1043,6 +1054,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 2
|
||||
,.headers=
|
||||
{ {"Content-Type", "text/plain" }
|
||||
@@ -1068,6 +1080,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 2
|
||||
,.headers=
|
||||
{ {"Content-Type", "text/html; charset=utf-8" }
|
||||
@@ -1091,6 +1104,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 4
|
||||
,.headers=
|
||||
{ {"Content-Type", "text/html; charset=UTF-8" }
|
||||
@@ -1116,6 +1130,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 4
|
||||
,.headers=
|
||||
{ {"Server", "DCLK-AdSvr" }
|
||||
@@ -1148,6 +1163,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 0
|
||||
,.status_code= 301
|
||||
,.response_status= "Moved Permanently"
|
||||
,.num_headers= 9
|
||||
,.headers=
|
||||
{ { "Date", "Thu, 03 Jun 2010 09:56:32 GMT" }
|
||||
@@ -1186,6 +1202,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 11
|
||||
,.headers=
|
||||
{ { "Date", "Tue, 28 Sep 2010 01:14:13 GMT" }
|
||||
@@ -1217,6 +1234,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 500
|
||||
,.response_status= "Oriëntatieprobleem"
|
||||
,.num_headers= 3
|
||||
,.headers=
|
||||
{ { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" }
|
||||
@@ -1237,6 +1255,7 @@ const struct message responses[] =
|
||||
,.http_major= 0
|
||||
,.http_minor= 9
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 0
|
||||
,.headers=
|
||||
{}
|
||||
@@ -1259,6 +1278,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Content-Type", "text/plain" }
|
||||
@@ -1277,6 +1297,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 0
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Connection", "keep-alive" }
|
||||
@@ -1296,6 +1317,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 0
|
||||
,.status_code= 204
|
||||
,.response_status= "No content"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Connection", "keep-alive" }
|
||||
@@ -1314,6 +1336,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 0
|
||||
,.headers={}
|
||||
,.body_size= 0
|
||||
@@ -1330,6 +1353,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 204
|
||||
,.response_status= "No content"
|
||||
,.num_headers= 0
|
||||
,.headers={}
|
||||
,.body_size= 0
|
||||
@@ -1347,6 +1371,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 204
|
||||
,.response_status= "No content"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Connection", "close" }
|
||||
@@ -1368,6 +1393,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 1
|
||||
,.headers=
|
||||
{ { "Transfer-Encoding", "chunked" }
|
||||
@@ -1396,6 +1422,7 @@ const struct message responses[] =
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 7
|
||||
,.headers=
|
||||
{ { "Server", "Microsoft-IIS/6.0" }
|
||||
@@ -1410,6 +1437,60 @@ const struct message responses[] =
|
||||
}
|
||||
#endif /* !HTTP_PARSER_STRICT */
|
||||
|
||||
#define AMAZON_COM 20
|
||||
, {.name= "amazon.com"
|
||||
,.type= HTTP_RESPONSE
|
||||
,.raw= "HTTP/1.1 301 MovedPermanently\r\n"
|
||||
"Date: Wed, 15 May 2013 17:06:33 GMT\r\n"
|
||||
"Server: Server\r\n"
|
||||
"x-amz-id-1: 0GPHKXSJQ826RK7GZEB2\r\n"
|
||||
"p3p: policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"\r\n"
|
||||
"x-amz-id-2: STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD\r\n"
|
||||
"Location: http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846\r\n"
|
||||
"Vary: Accept-Encoding,User-Agent\r\n"
|
||||
"Content-Type: text/html; charset=ISO-8859-1\r\n"
|
||||
"Transfer-Encoding: chunked\r\n"
|
||||
"\r\n"
|
||||
"1\r\n"
|
||||
"\n\r\n"
|
||||
"0\r\n"
|
||||
"\r\n"
|
||||
,.should_keep_alive= TRUE
|
||||
,.message_complete_on_eof= FALSE
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 301
|
||||
,.response_status= "MovedPermanently"
|
||||
,.num_headers= 9
|
||||
,.headers= { { "Date", "Wed, 15 May 2013 17:06:33 GMT" }
|
||||
, { "Server", "Server" }
|
||||
, { "x-amz-id-1", "0GPHKXSJQ826RK7GZEB2" }
|
||||
, { "p3p", "policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"" }
|
||||
, { "x-amz-id-2", "STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD" }
|
||||
, { "Location", "http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846" }
|
||||
, { "Vary", "Accept-Encoding,User-Agent" }
|
||||
, { "Content-Type", "text/html; charset=ISO-8859-1" }
|
||||
, { "Transfer-Encoding", "chunked" }
|
||||
}
|
||||
,.body= "\n"
|
||||
}
|
||||
|
||||
#define EMPTY_REASON_PHRASE_AFTER_SPACE 20
|
||||
, {.name= "empty reason phrase after space"
|
||||
,.type= HTTP_RESPONSE
|
||||
,.raw= "HTTP/1.1 200 \r\n"
|
||||
"\r\n"
|
||||
,.should_keep_alive= FALSE
|
||||
,.message_complete_on_eof= TRUE
|
||||
,.http_major= 1
|
||||
,.http_minor= 1
|
||||
,.status_code= 200
|
||||
,.response_status= ""
|
||||
,.num_headers= 0
|
||||
,.headers= {}
|
||||
,.body= ""
|
||||
}
|
||||
|
||||
, {.name= NULL } /* sentinel */
|
||||
};
|
||||
|
||||
@@ -1491,13 +1572,6 @@ request_url_cb (http_parser *p, const char *buf, size_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
status_complete_cb (http_parser *p) {
|
||||
assert(p == parser);
|
||||
p->data++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
header_field_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
@@ -1623,6 +1697,17 @@ message_complete_cb (http_parser *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
response_status_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
assert(p == parser);
|
||||
strlncat(messages[num_messages].response_status,
|
||||
sizeof(messages[num_messages].response_status),
|
||||
buf,
|
||||
len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* These dontcall_* callbacks exist so that we can verify that when we're
|
||||
* paused, no additional callbacks are invoked */
|
||||
int
|
||||
@@ -1683,11 +1768,20 @@ dontcall_message_complete_cb (http_parser *p)
|
||||
abort();
|
||||
}
|
||||
|
||||
int
|
||||
dontcall_response_status_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
if (p || buf || len) { } // gcc
|
||||
fprintf(stderr, "\n\n*** on_status() called on paused parser ***\n\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
static http_parser_settings settings_dontcall =
|
||||
{.on_message_begin = dontcall_message_begin_cb
|
||||
,.on_header_field = dontcall_header_field_cb
|
||||
,.on_header_value = dontcall_header_value_cb
|
||||
,.on_url = dontcall_request_url_cb
|
||||
,.on_status = dontcall_response_status_cb
|
||||
,.on_body = dontcall_body_cb
|
||||
,.on_headers_complete = dontcall_headers_complete_cb
|
||||
,.on_message_complete = dontcall_message_complete_cb
|
||||
@@ -1753,11 +1847,20 @@ pause_message_complete_cb (http_parser *p)
|
||||
return message_complete_cb(p);
|
||||
}
|
||||
|
||||
int
|
||||
pause_response_status_cb (http_parser *p, const char *buf, size_t len)
|
||||
{
|
||||
http_parser_pause(p, 1);
|
||||
*current_pause_parser = settings_dontcall;
|
||||
return response_status_cb(p, buf, len);
|
||||
}
|
||||
|
||||
static http_parser_settings settings_pause =
|
||||
{.on_message_begin = pause_message_begin_cb
|
||||
,.on_header_field = pause_header_field_cb
|
||||
,.on_header_value = pause_header_value_cb
|
||||
,.on_url = pause_request_url_cb
|
||||
,.on_status = pause_response_status_cb
|
||||
,.on_body = pause_body_cb
|
||||
,.on_headers_complete = pause_headers_complete_cb
|
||||
,.on_message_complete = pause_message_complete_cb
|
||||
@@ -1768,6 +1871,7 @@ static http_parser_settings settings =
|
||||
,.on_header_field = header_field_cb
|
||||
,.on_header_value = header_value_cb
|
||||
,.on_url = request_url_cb
|
||||
,.on_status = response_status_cb
|
||||
,.on_body = body_cb
|
||||
,.on_headers_complete = headers_complete_cb
|
||||
,.on_message_complete = message_complete_cb
|
||||
@@ -1778,6 +1882,7 @@ static http_parser_settings settings_count_body =
|
||||
,.on_header_field = header_field_cb
|
||||
,.on_header_value = header_value_cb
|
||||
,.on_url = request_url_cb
|
||||
,.on_status = response_status_cb
|
||||
,.on_body = count_body_cb
|
||||
,.on_headers_complete = headers_complete_cb
|
||||
,.on_message_complete = message_complete_cb
|
||||
@@ -1788,6 +1893,7 @@ static http_parser_settings settings_null =
|
||||
,.on_header_field = 0
|
||||
,.on_header_value = 0
|
||||
,.on_url = 0
|
||||
,.on_status = 0
|
||||
,.on_body = 0
|
||||
,.on_headers_complete = 0
|
||||
,.on_message_complete = 0
|
||||
@@ -1911,6 +2017,7 @@ message_eq (int index, const struct message *expected)
|
||||
MESSAGE_CHECK_NUM_EQ(expected, m, method);
|
||||
} else {
|
||||
MESSAGE_CHECK_NUM_EQ(expected, m, status_code);
|
||||
MESSAGE_CHECK_STR_EQ(expected, m, response_status);
|
||||
}
|
||||
|
||||
MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive);
|
||||
@@ -2831,7 +2938,7 @@ test_header_content_length_overflow_error (void)
|
||||
"HTTP/1.1 200 OK\r\n" \
|
||||
"Content-Length: " #size "\r\n" \
|
||||
"\r\n"
|
||||
const char a[] = X(18446744073709551614); /* 2^64-2 */
|
||||
const char a[] = X(1844674407370955160); /* 2^64 / 10 - 1 */
|
||||
const char b[] = X(18446744073709551615); /* 2^64-1 */
|
||||
const char c[] = X(18446744073709551616); /* 2^64 */
|
||||
#undef X
|
||||
@@ -2849,7 +2956,7 @@ test_chunk_content_length_overflow_error (void)
|
||||
"\r\n" \
|
||||
#size "\r\n" \
|
||||
"..."
|
||||
const char a[] = X(FFFFFFFFFFFFFFFE); /* 2^64-2 */
|
||||
const char a[] = X(FFFFFFFFFFFFFFE); /* 2^64 / 16 - 1 */
|
||||
const char b[] = X(FFFFFFFFFFFFFFFF); /* 2^64-1 */
|
||||
const char c[] = X(10000000000000000); /* 2^64 */
|
||||
#undef X
|
||||
@@ -3096,20 +3203,6 @@ create_large_chunked_message (int body_size_in_kb, const char* headers)
|
||||
return buf;
|
||||
}
|
||||
|
||||
void
|
||||
test_status_complete (void)
|
||||
{
|
||||
parser_init(HTTP_RESPONSE);
|
||||
parser->data = 0;
|
||||
http_parser_settings settings = settings_null;
|
||||
settings.on_status_complete = status_complete_cb;
|
||||
|
||||
char *response = "don't mind me, just a simple response";
|
||||
http_parser_execute(parser, &settings, response, strlen(response));
|
||||
assert(parser->data == (void*)0); // the status_complete callback was never called
|
||||
assert(parser->http_errno == HPE_INVALID_CONSTANT); // the errno for an invalid status line
|
||||
}
|
||||
|
||||
/* Verify that we can pause parsing at any of the bytes in the
|
||||
* message and still get the result that we're expecting. */
|
||||
void
|
||||
@@ -3243,6 +3336,7 @@ main (void)
|
||||
,.http_major= 1
|
||||
,.http_minor= 0
|
||||
,.status_code= 200
|
||||
,.response_status= "OK"
|
||||
,.num_headers= 2
|
||||
,.headers=
|
||||
{ { "Transfer-Encoding", "chunked" }
|
||||
@@ -3431,8 +3525,6 @@ main (void)
|
||||
, &requests[CONNECT_REQUEST]
|
||||
);
|
||||
|
||||
test_status_complete();
|
||||
|
||||
puts("requests okay");
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
namespace beast {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4127) // conditional expression is constant
|
||||
#pragma warning (disable: 4244) // integer conversion, possible loss of data
|
||||
# pragma warning (push)
|
||||
# pragma warning (disable: 4127) // conditional expression is constant
|
||||
# pragma warning (disable: 4244) // integer conversion, possible loss of data
|
||||
#endif
|
||||
#include "http-parser/http_parser.c"
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (pop)
|
||||
# pragma warning (pop)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
33
src/beast/beast/http/impl/http_parser.h
Normal file
33
src/beast/beast/http/impl/http_parser.h
Normal file
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_HTTP_HTTP_PARSER_H_INCLUDED
|
||||
#define BEAST_HTTP_HTTP_PARSER_H_INCLUDED
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
// Wraps the C-language joyent http parser header in our namespace
|
||||
|
||||
namespace beast {
|
||||
|
||||
#include "http-parser/http_parser.h"
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
38
src/beast/beast/insight/Base.h
Normal file
38
src/beast/beast/insight/Base.h
Normal file
@@ -0,0 +1,38 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_INSIGHT_BASE_H_INCLUDED
|
||||
#define BEAST_INSIGHT_BASE_H_INCLUDED
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
namespace insight {
|
||||
|
||||
/** Base for all metrics and hooks. */
|
||||
class Base
|
||||
{
|
||||
public:
|
||||
virtual ~Base () = 0;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
40
src/beast/beast/insight/BaseImpl.h
Normal file
40
src/beast/beast/insight/BaseImpl.h
Normal file
@@ -0,0 +1,40 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef BEAST_INSIGHT_BASEIMPL_H_INCLUDED
|
||||
#define BEAST_INSIGHT_BASEIMPL_H_INCLUDED
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
namespace insight {
|
||||
|
||||
/** Base for all metrics and hook implementations. */
|
||||
class BaseImpl
|
||||
{
|
||||
public:
|
||||
typedef std::shared_ptr <BaseImpl> ptr;
|
||||
|
||||
virtual ~BaseImpl () = 0;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -44,6 +44,8 @@ namespace insight {
|
||||
class Collector
|
||||
{
|
||||
public:
|
||||
typedef std::shared_ptr <Collector> ptr;
|
||||
|
||||
virtual ~Collector() = 0;
|
||||
|
||||
/** Create a hook.
|
||||
@@ -71,22 +73,58 @@ public:
|
||||
/** Create a counter with the specified name.
|
||||
@see Counter
|
||||
*/
|
||||
/** @{ */
|
||||
virtual Counter make_counter (std::string const& name) = 0;
|
||||
|
||||
Counter make_counter (std::string const& prefix, std::string const& name)
|
||||
{
|
||||
if (prefix.empty ())
|
||||
return make_counter (name);
|
||||
return make_counter (prefix + "." + name);
|
||||
}
|
||||
/** @} */
|
||||
|
||||
/** Create an event with the specified name.
|
||||
@see Event
|
||||
*/
|
||||
/** @{ */
|
||||
virtual Event make_event (std::string const& name) = 0;
|
||||
|
||||
Event make_event (std::string const& prefix, std::string const& name)
|
||||
{
|
||||
if (prefix.empty ())
|
||||
return make_event (name);
|
||||
return make_event (prefix + "." + name);
|
||||
}
|
||||
/** @} */
|
||||
|
||||
/** Create a gauge with the specified name.
|
||||
@see Gauge
|
||||
*/
|
||||
/** @{ */
|
||||
virtual Gauge make_gauge (std::string const& name) = 0;
|
||||
|
||||
Gauge make_gauge (std::string const& prefix, std::string const& name)
|
||||
{
|
||||
if (prefix.empty ())
|
||||
return make_gauge (name);
|
||||
return make_gauge (prefix + "." + name);
|
||||
}
|
||||
/** @} */
|
||||
|
||||
/** Create a meter with the specified name.
|
||||
@see Meter
|
||||
*/
|
||||
/** @{ */
|
||||
virtual Meter make_meter (std::string const& name) = 0;
|
||||
|
||||
Meter make_meter (std::string const& prefix, std::string const& name)
|
||||
{
|
||||
if (prefix.empty ())
|
||||
return make_meter (name);
|
||||
return make_meter (prefix + "." + name);
|
||||
}
|
||||
/** @} */
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Base.h"
|
||||
#include "CounterImpl.h"
|
||||
|
||||
namespace beast {
|
||||
@@ -35,7 +36,7 @@ namespace insight {
|
||||
This is a lightweight reference wrapper which is cheap to copy and assign.
|
||||
When the last reference goes away, the metric is no longer collected.
|
||||
*/
|
||||
class Counter
|
||||
class Counter : public Base
|
||||
{
|
||||
public:
|
||||
typedef CounterImpl::value_type value_type;
|
||||
@@ -57,21 +58,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
/** Set a handler for polling.
|
||||
If a handler is set, it will be called once per collection interval.
|
||||
This may be used to implement polling style collection instead of
|
||||
push style.
|
||||
|
||||
Handler will be called with this signature:
|
||||
void Handler (Counter const&);
|
||||
*/
|
||||
template <class Handler>
|
||||
void set_handler (Handler handler) const
|
||||
{
|
||||
if (m_impl)
|
||||
m_impl->set_handler (handler);
|
||||
}
|
||||
|
||||
/** Increment the counter. */
|
||||
/** @{ */
|
||||
void increment (value_type amount) const
|
||||
@@ -99,6 +85,11 @@ public:
|
||||
{ increment (-1); return *this; }
|
||||
/** @} */
|
||||
|
||||
std::shared_ptr <CounterImpl> const& impl () const
|
||||
{
|
||||
return m_impl;
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr <CounterImpl> m_impl;
|
||||
};
|
||||
|
||||
@@ -20,23 +20,24 @@
|
||||
#ifndef BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED
|
||||
#define BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include "BaseImpl.h"
|
||||
|
||||
namespace beast {
|
||||
namespace insight {
|
||||
|
||||
class Counter;
|
||||
|
||||
class CounterImpl : public std::enable_shared_from_this <CounterImpl>
|
||||
class CounterImpl
|
||||
: public std::enable_shared_from_this <CounterImpl>
|
||||
, public BaseImpl
|
||||
{
|
||||
public:
|
||||
typedef int64 value_type;
|
||||
typedef std::function <void (Counter const&)> HandlerType;
|
||||
|
||||
virtual ~CounterImpl () = 0;
|
||||
virtual void increment (value_type amount) = 0;
|
||||
virtual void set_handler (HandlerType const& handler) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,10 +20,14 @@
|
||||
#ifndef BEAST_INSIGHT_EVENT_H_INCLUDED
|
||||
#define BEAST_INSIGHT_EVENT_H_INCLUDED
|
||||
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
|
||||
#include "Base.h"
|
||||
#include "EventImpl.h"
|
||||
|
||||
#include "../chrono/chrono_util.h"
|
||||
|
||||
namespace beast {
|
||||
namespace insight {
|
||||
|
||||
@@ -36,7 +40,7 @@ namespace insight {
|
||||
This is a lightweight reference wrapper which is cheap to copy and assign.
|
||||
When the last reference goes away, the metric is no longer collected.
|
||||
*/
|
||||
class Event
|
||||
class Event : public Base
|
||||
{
|
||||
public:
|
||||
typedef EventImpl::value_type value_type;
|
||||
@@ -45,8 +49,7 @@ public:
|
||||
A null metric reports no information.
|
||||
*/
|
||||
Event ()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
/** Create the metric reference the specified implementation.
|
||||
Normally this won't be called directly. Instead, call the appropriate
|
||||
@@ -55,17 +58,19 @@ public:
|
||||
*/
|
||||
explicit Event (std::shared_ptr <EventImpl> const& impl)
|
||||
: m_impl (impl)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
/** Push an event notification.
|
||||
The value specifies the elapsed time in milliseconds, or any other
|
||||
domain specific value.
|
||||
*/
|
||||
void notify (value_type value) const
|
||||
/** Push an event notification. */
|
||||
template <class Rep, class Period>
|
||||
void notify (std::chrono::duration <Rep, Period> const& value) const
|
||||
{
|
||||
if (m_impl)
|
||||
m_impl->notify (value);
|
||||
m_impl->notify (ceil <value_type> (value));
|
||||
}
|
||||
|
||||
std::shared_ptr <EventImpl> const& impl () const
|
||||
{
|
||||
return m_impl;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -22,18 +22,22 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "BaseImpl.h"
|
||||
|
||||
namespace beast {
|
||||
namespace insight {
|
||||
|
||||
class Event;
|
||||
|
||||
class EventImpl : public std::enable_shared_from_this <EventImpl>
|
||||
class EventImpl
|
||||
: public std::enable_shared_from_this <EventImpl>
|
||||
, public BaseImpl
|
||||
{
|
||||
public:
|
||||
typedef uint64 value_type;
|
||||
typedef std::chrono::milliseconds value_type;
|
||||
|
||||
virtual ~EventImpl () = 0;
|
||||
virtual void notify (value_type value) = 0;
|
||||
virtual void notify (value_type const& value) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user