Skip to content

Commit

Permalink
silenced build warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-crowhurst committed Jul 12, 2017
1 parent 3d45a5f commit 468788c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
8 changes: 4 additions & 4 deletions source/corvusoft/protocol/detail/http_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace corvusoft
return 0;
}

static std::size_t compose_request( core::Bytes& data, const std::shared_ptr< Message >& message, std::error_code& error )
static std::size_t compose_request( core::Bytes& data, const std::shared_ptr< Message >& message )
{
data = message->get( "request:method" );
data.emplace_back( ' ' );
Expand All @@ -181,7 +181,7 @@ namespace corvusoft
return data.size( );
}

static std::size_t compose_response( core::Bytes& data, const std::shared_ptr< Message >& message, std::error_code& error )
static std::size_t compose_response( core::Bytes& data, const std::shared_ptr< Message >& message )
{
data = message->get( "response:protocol" );
data.emplace_back( '/' );
Expand All @@ -208,7 +208,7 @@ namespace corvusoft
return data.size( );
}

static std::size_t compose_header( core::Bytes& data, const std::pair< const std::string, const core::Bytes >& property )
static void compose_header( core::Bytes& data, const std::pair< const std::string, const core::Bytes >& property )
{
const auto& name = property.first;
data.insert( data.end( ), name.begin( ), name.end( ) );
Expand All @@ -221,7 +221,7 @@ namespace corvusoft
data.emplace_back( '\n' );
}

static std::size_t compose_body( core::Bytes& data, const core::Bytes& value )
static void compose_body( core::Bytes& data, const core::Bytes& value )
{
data.emplace_back( '\r' );
data.emplace_back( '\n' );
Expand Down
8 changes: 2 additions & 6 deletions source/corvusoft/protocol/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ namespace corvusoft
return error_code( );
}

//mention in documentation this only reads to the start of body!
//add list arguemnt for parse and compose.
error_code HTTP::parse( const shared_ptr< Adaptor > adaptor, const shared_ptr< Message > message ) noexcept
{
if ( adaptor == nullptr ) return make_error_code( std::errc::invalid_argument );
Expand All @@ -83,7 +81,6 @@ namespace corvusoft
return make_error_code( std::errc::wrong_protocol_type );

//adaptor->purge( length, error );

return error;
}

Expand All @@ -92,7 +89,6 @@ namespace corvusoft
return error_code( );
}

//mentioned the reserved words in message message, path, etc...
error_code HTTP::compose( const shared_ptr< Adaptor > adaptor, const shared_ptr< Message > message ) noexcept
{
if ( adaptor == nullptr ) return make_error_code( std::errc::invalid_argument );
Expand All @@ -103,9 +99,9 @@ namespace corvusoft
size_t length = 0;

if ( m_pimpl->uppercase( message->get( "request:protocol" ) ) == "HTTP" )
length = m_pimpl->compose_request( data, message, error );
length = m_pimpl->compose_request( data, message );
else if ( m_pimpl->uppercase( message->get( "response:protocol" ) ) == "HTTP" )
length = m_pimpl->compose_response( data, message, error );
length = m_pimpl->compose_response( data, message );
else
return std::make_error_code( std::errc::wrong_protocol_type );

Expand Down
9 changes: 2 additions & 7 deletions source/corvusoft/protocol/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,10 @@ namespace corvusoft
void Message::erase( const string& name )
{
auto& properties = m_pimpl->properties;
properties.erase(
remove_if( properties.begin( ), properties.end( ),
[ &name ]( const auto & property )
properties.erase( remove_if( properties.begin( ), properties.end( ), [ &name ]( const auto & property )
{
return property.first == name;
}
),
properties.end( )
);
} ), properties.end( ) );
}

vector< pair< string, Bytes > > Message::get( void ) const
Expand Down

0 comments on commit 468788c

Please sign in to comment.