Commit 0a000b46 authored by zhujiashun's avatar zhujiashun

remove unnecessary code

parent 3799ed32
......@@ -12,6 +12,7 @@
*.prof
*.so
*.dylib
*.rej
/output
/test/output
......
......@@ -100,7 +100,6 @@ public:
_cntl->_request_protocol = protocol;
return *this;
}
ProtocolType request_protocol() { return _cntl->_request_protocol; }
Span* span() const { return _cntl->_span; }
......
diff a/src/brpc/options.proto b/src/brpc/options.proto (rejected hunks)
@@ -53,6 +53,7 @@ enum ProtocolType {
// Reserve special protocol for cds-agent, which depends on FIFO right now
PROTOCOL_CDS_AGENT = 23; // Client side only
PROTOCOL_ESP = 24; // Client side only
+ PROTOCOL_HTTP2 = 25;
}
message ChunkInfo {
......@@ -280,7 +280,7 @@ void ProcessHttpResponse(InputMessageBase* msg) {
res_body.cut1(&grpc_compressed);
res_body.cutn(buf, 4);
int message_length = ReadBigEndian4Bytes(buf);
CHECK(message_length == res_body.length()) << message_length
CHECK((size_t)message_length == res_body.length()) << message_length
<< " vs " << res_body.length();
}
......@@ -531,7 +531,7 @@ void SerializeHttpRequest(butil::IOBuf* /*not used*/,
butil::IOBuf compressed;
if (GzipCompress(cntl->request_attachment(), &compressed, NULL)) {
cntl->request_attachment().swap(compressed);
if (accessor.request_protocol() == PROTOCOL_GRPC) {
if (cntl->request_protocol() == PROTOCOL_GRPC) {
grpc_compressed = true;
cntl->http_request().SetHeader(common->GRPC_ENCODING, common->GZIP);
} else {
......@@ -563,7 +563,7 @@ void SerializeHttpRequest(butil::IOBuf* /*not used*/,
cntl->set_stream_creator(get_h2_global_stream_creator());
}
if (accessor.request_protocol() == PROTOCOL_GRPC) {
if (cntl->request_protocol() == PROTOCOL_GRPC) {
// always tell client gzip support
// TODO(zhujiashun): add zlib and snappy?
header->SetHeader(common->GRPC_ACCEPT_ENCODING,
......
......@@ -783,8 +783,6 @@ private:
butil::Mutex _stream_mutex;
std::set<StreamId> *_stream_set;
SocketUniquePtr _agent_socket;
};
} // namespace brpc
......
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