adds new tls_short_read transport error

This commit is contained in:
Peter Thorson
2013-05-05 19:06:55 -05:00
parent dc7872d647
commit f6f4befe46
4 changed files with 18 additions and 11 deletions

View File

@@ -744,8 +744,8 @@ void connection<config>::handle_read_frame(const lib::error_code& ec,
return;
}
}
if (ec.value() == 335544539 /*TLS short read */) {
m_alog.write(log::alevel::devel,"got TLS short read, ignore for the moment");
if (ec == transport::error::tls_short_read) {
m_elog.write(log::elevel::rerror,"got TLS short read, ignore for the moment");
return;
}

View File

@@ -449,13 +449,16 @@ protected:
if (ec == boost::asio::error::eof) {
handler(make_error_code(transport::error::eof),
bytes_transferred);
} else if (ec.value() == 335544539) {
handler(make_error_code(transport::error::tls_short_read),
bytes_transferred);
} else {
// other error that we cannot translate into a WebSocket++
// transport error. Use pass through and print an info warning
// with the original error.
std::stringstream s;
s << "asio async_read_at_least error::pass_through"
<< ", Original Error: " << ec << " (" << ec.message() << ")";
s << "asio async_read_at_least error: "
<< ec << " (" << ec.message() << ")";
m_elog.write(log::elevel::info,s.str());
handler(make_error_code(transport::error::pass_through),
bytes_transferred);

View File

@@ -308,8 +308,7 @@ public:
h(make_error_code(transport::error::operation_aborted));
} else if (ec) {
std::stringstream s;
s << "asio async_wait error::pass_through"
<< "Original Error: " << ec << " (" << ec.message() << ")";
s << "asio async_wait error: " << ec << " (" << ec.message() << ")";
m_elog->write(log::elevel::devel,s.str());
h(make_error_code(transport::error::pass_through));
} else {
@@ -418,8 +417,8 @@ protected:
//con->terminate();
// TODO: Better translation of errors at this point
std::stringstream s;
s << "asio async_resolve error::pass_through: "
<< "Original Error: " << ec << " (" << ec.message() << ")";
s << "asio async_resolve error:"
<< ec << " (" << ec.message() << ")";
m_elog->write(log::elevel::info,s.str());
callback(tcon->get_handle(),make_error_code(error::pass_through));
return;
@@ -460,8 +459,8 @@ protected:
//con->terminate();
// TODO: Better translation of errors at this point
std::stringstream s;
s << "asio async_connect error::pass_through: "
<< "Original Error: " << ec << " (" << ec.message() << ")";
s << "asio async_connect error: "
<< ec << " (" << ec.message() << ")";
m_elog->write(log::elevel::info,s.str());
callback(tcon->get_handle(),make_error_code(error::pass_through));
return;

View File

@@ -104,7 +104,10 @@ enum value {
operation_not_supported,
/// End of file
eof
eof,
/// TLS short read
tls_short_read
};
class category : public lib::error_category {
@@ -129,6 +132,8 @@ class category : public lib::error_category {
return "The operation is not supported by this transport";
case eof:
return "End of File";
case tls_short_read:
return "TLS Short Read";
default:
return "Unknown";
}