Add is_short_read()

This commit is contained in:
Vinnie Falco
2014-09-12 14:10:07 -07:00
parent 1a7eafb699
commit 79db0ca7a6
3 changed files with 41 additions and 11 deletions

View File

@@ -3292,8 +3292,6 @@
</ClInclude>
<ClInclude Include="..\..\src\ripple\sslutil\api\ECDSACanonical.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\sslutil\api\HashUtilities.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\sslutil\impl\CBigNum.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
@@ -3303,9 +3301,6 @@
<ClCompile Include="..\..\src\ripple\sslutil\impl\ECDSACanonical.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\sslutil\impl\HashUtilities.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\testoverlay\api\ConfigType.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\testoverlay\api\ConnectionType.h">

View File

@@ -4560,9 +4560,6 @@
<ClInclude Include="..\..\src\ripple\sslutil\api\ECDSACanonical.h">
<Filter>ripple\sslutil\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\sslutil\api\HashUtilities.h">
<Filter>ripple\sslutil\api</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\sslutil\impl\CBigNum.cpp">
<Filter>ripple\sslutil\impl</Filter>
</ClCompile>
@@ -4572,9 +4569,6 @@
<ClCompile Include="..\..\src\ripple\sslutil\impl\ECDSACanonical.cpp">
<Filter>ripple\sslutil\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\sslutil\impl\HashUtilities.cpp">
<Filter>ripple\sslutil\impl</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\testoverlay\api\ConfigType.h">
<Filter>ripple\testoverlay\api</Filter>
</ClInclude>

View 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_SSL_H_INCLUDED
#define BEAST_ASIO_SSL_H_INCLUDED
#include <boost/asio/ssl/error.hpp>
#include <boost/system/error_code.hpp>
namespace beast {
namespace asio {
/** Returns `true` if the error code is a SSL "short read." */
inline
bool
is_short_read (boost::system::error_code const& ec)
{
return (ec.category() == boost::asio::error::get_ssl_category())
&& (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ);
}
}
}
#endif