Commit 7a0d45a3 authored by gejun's avatar gejun

rebase http2

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