Commit 7a0d45a3 authored by gejun's avatar gejun

rebase http2

parent e20c4ef6
......@@ -96,7 +96,6 @@ public:
_cntl->_request_protocol = protocol;
return *this;
}
ProtocolType request_protocol() { return _cntl->_request_protocol; }
Span* span() const { return _cntl->_span; }
......
......@@ -22,7 +22,6 @@
namespace brpc {
struct H2Settings {
// Allows the sender to inform the remote endpoint of the maximum size of
// the header compression table used to decode header blocks, in octets.
......@@ -123,7 +122,6 @@ enum H2Error {
const char* H2ErrorToString(H2Error e);
} // namespace brpc
#endif // BAIDU_RPC_HTTP2_H
......@@ -1491,7 +1491,7 @@ void H2UnsentRequest::Describe(butil::IOBuf* desc) const {
size_t nskipped = body->size() - (size_t)FLAGS_http_verbose_max_body_length;
body->append_to(desc, FLAGS_http_verbose_max_body_length);
if (nskipped) {
char str[32];
char str[48];
snprintf(str, sizeof(str), "\n<skipped %" PRIu64 " bytes>", nskipped);
desc->append(str);
}
......@@ -1615,7 +1615,7 @@ void H2UnsentResponse::Describe(butil::IOBuf* desc) const {
size_t nskipped = _data.size() - (size_t)FLAGS_http_verbose_max_body_length;
_data.append_to(desc, FLAGS_http_verbose_max_body_length);
if (nskipped) {
char str[32];
char str[48];
snprintf(str, sizeof(str), "\n<skipped %" PRIu64 " bytes>", nskipped);
desc->append(str);
}
......@@ -1649,6 +1649,7 @@ void PackH2Request(butil::IOBuf*,
static_cast<H2UnsentRequest*>(cntl->stream_creator())->RemoveRefManually();
}
cntl->set_stream_creator(h2_req);
h2_req->AddRefManually();
*user_message = h2_req;
......@@ -1682,8 +1683,6 @@ void H2GlobalStreamCreator::ReplaceSocketForStream(
SocketId sid;
SocketOptions opt = (*inout)->_options;
// Only main socket can be the owner of ssl_ctx
opt.owns_ssl_ctx = false;
opt.health_check_interval_s = -1;
// TODO(zhujiashun): Predictively create socket to improve performance
if (get_client_side_messenger()->Create(opt, &sid) != 0) {
......
......@@ -466,7 +466,7 @@ void SerializeHttpRequest(butil::IOBuf* /*not used*/,
header->SetHeader(common->CONNECTION, common->KEEP_ALIVE);
}
if (accessor.request_protocol() == PROTOCOL_HTTP2) {
if (cntl->request_protocol() == PROTOCOL_HTTP2) {
cntl->set_stream_creator(get_h2_global_stream_creator());
}
......
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