Commit f2eb9cb4 authored by zhujiashun's avatar zhujiashun

Polish h2 log description

parent 692e70aa
......@@ -470,7 +470,7 @@ ParseResult H2Context::Consume(
Socket::WriteOptions wopt;
wopt.ignore_eovercrowded = true;
if (socket->Write(&buf, &wopt) != 0) {
LOG(WARNING) << "Fail to respond http2-client with settings to " << socket->remote_side();
LOG(WARNING) << "Fail to respond http2-client with settings to " << *socket
return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG);
}
} else {
......@@ -502,7 +502,7 @@ ParseResult H2Context::Consume(
Socket::WriteOptions wopt;
wopt.ignore_eovercrowded = true;
if (_socket->Write(&sendbuf, &wopt) != 0) {
LOG(WARNING) << "Fail to send RST_STREAM to " << _socket->remote_side();
LOG(WARNING) << "Fail to send RST_STREAM to " << *_socket;
return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG);
}
return MakeMessage(NULL);
......@@ -516,7 +516,7 @@ ParseResult H2Context::Consume(
Socket::WriteOptions wopt;
wopt.ignore_eovercrowded = true;
if (_socket->Write(&sendbuf, &wopt) != 0) {
LOG(WARNING) << "Fail to send GOAWAY to " << _socket->remote_side();
LOG(WARNING) << "Fail to send GOAWAY to " << *_socket;
return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG);
}
return MakeMessage(NULL);
......@@ -721,7 +721,7 @@ H2ParseResult H2StreamContext::OnData(
for (size_t i = 0; i < data.backing_block_num(); ++i) {
const butil::StringPiece blk = data.backing_block(i);
if (OnBody(blk.data(), blk.size()) != 0) {
LOG(ERROR) << "Fail to parse h2 data as http body";
LOG(ERROR) << "Fail to parse data";
return MakeH2Error(H2_PROTOCOL_ERROR);
}
}
......@@ -748,7 +748,7 @@ H2ParseResult H2StreamContext::OnData(
Socket::WriteOptions wopt;
wopt.ignore_eovercrowded = true;
if (_conn_ctx->_socket->Write(&sendbuf, &wopt) != 0) {
LOG(WARNING) << "Fail to send WINDOW_UPDATE to " << _conn_ctx->_socket->remote_side();
LOG(WARNING) << "Fail to send WINDOW_UPDATE to " << *_conn_ctx->_socket;
return MakeH2Error(H2_INTERNAL_ERROR);
}
}
......@@ -866,9 +866,6 @@ H2ParseResult H2Context::OnSettings(
for (StreamMap::const_iterator it = _pending_streams.begin();
it != _pending_streams.end(); ++it) {
if (!AddWindowSize(&it->second->_remote_window_left, window_diff)) {
LOG(WARNING) << "Fail to add window_diff=" << window_diff
<< " to remote_window_left="
<< it->second->_remote_window_left.load(butil::memory_order_relaxed);
return MakeH2Error(H2_FLOW_CONTROL_ERROR);
}
}
......@@ -881,7 +878,7 @@ H2ParseResult H2Context::OnSettings(
Socket::WriteOptions wopt;
wopt.ignore_eovercrowded = true;
if (_socket->Write(&sendbuf, &wopt) != 0) {
LOG(WARNING) << "Fail to respond settings with ack to " << _socket->remote_side();
LOG(WARNING) << "Fail to respond settings with ack to " << *_socket;
return MakeH2Error(H2_PROTOCOL_ERROR);
}
return MakeH2Message(NULL);
......@@ -921,7 +918,7 @@ H2ParseResult H2Context::OnPing(
Socket::WriteOptions wopt;
wopt.ignore_eovercrowded = true;
if (_socket->Write(&sendbuf, &wopt) != 0) {
LOG(WARNING) << "Fail to send ack of PING to " << _socket->remote_side();
LOG(WARNING) << "Fail to send ack of PING to " << *_socket;
return MakeH2Error(H2_PROTOCOL_ERROR);
}
return MakeH2Message(NULL);
......@@ -976,8 +973,7 @@ H2ParseResult H2Context::OnWindowUpdate(
}
if (frame_head.stream_id == 0) {
if (!AddWindowSize(&_remote_window_left, inc)) {
LOG(ERROR) << "Invalid connection-level window_size_increment=" << inc
<< " to remote_window_left=" << _remote_window_left;
LOG(ERROR) << "Invalid connection-level window_size_increment=" << inc;
return MakeH2Error(H2_FLOW_CONTROL_ERROR);
}
return MakeH2Message(NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment