Skip to content

Commit

Permalink
Rollback a change.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelKatz authored and vinniefalco committed May 3, 2013
1 parent 791fb83 commit b4b4f5c
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions src/roles/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,18 +539,36 @@ void server<endpoint>::connection<connection_type>::async_init() {
// TODO: make this value configurable
m_connection.register_timeout(5000,fail::status::TIMEOUT_WS,
"Timeout on WebSocket handshake");

boost::asio::async_read_until(
m_connection.get_socket(),
m_connection.buffer(),
match_header,
m_connection.get_strand().wrap(boost::bind(
&type::handle_read_request,
m_connection.shared_from_this(),
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred
))
);

if (m_connection.isSecure())
{
boost::asio::async_read_until(
m_connection.SSLSocket(),
m_connection.buffer(),
// match_header,
"\r\n\r\n",
m_connection.get_strand().wrap(boost::bind(
&type::handle_read_request,
m_connection.shared_from_this(),
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred
))
);
}
else
{
boost::asio::async_read_until(
m_connection.PlainSocket(),
m_connection.buffer(),
match_header,
m_connection.get_strand().wrap(boost::bind(
&type::handle_read_request,
m_connection.shared_from_this(),
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred
))
);
}
}

/// processes the response from an async read for an HTTP header
Expand Down Expand Up @@ -822,7 +840,7 @@ void server<endpoint>::connection<connection_type>::write_response() {

m_endpoint.m_alog->at(log::alevel::DEBUG_HANDSHAKE) << raw << log::endl;

boost::asio::async_write(
boost::asio::async_write( // FIXME
m_connection.get_socket(),
//boost::asio::buffer(raw),
buffer,
Expand Down

0 comments on commit b4b4f5c

Please sign in to comment.