Commit 0a000b46 authored by zhujiashun's avatar zhujiashun

remove unnecessary code

parent 3799ed32
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
*.prof *.prof
*.so *.so
*.dylib *.dylib
*.rej
/output /output
/test/output /test/output
......
...@@ -100,7 +100,6 @@ public: ...@@ -100,7 +100,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; }
......
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) { ...@@ -280,7 +280,7 @@ void ProcessHttpResponse(InputMessageBase* msg) {
res_body.cut1(&grpc_compressed); res_body.cut1(&grpc_compressed);
res_body.cutn(buf, 4); res_body.cutn(buf, 4);
int message_length = ReadBigEndian4Bytes(buf); 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(); << " vs " << res_body.length();
} }
...@@ -531,7 +531,7 @@ void SerializeHttpRequest(butil::IOBuf* /*not used*/, ...@@ -531,7 +531,7 @@ void SerializeHttpRequest(butil::IOBuf* /*not used*/,
butil::IOBuf compressed; butil::IOBuf compressed;
if (GzipCompress(cntl->request_attachment(), &compressed, NULL)) { if (GzipCompress(cntl->request_attachment(), &compressed, NULL)) {
cntl->request_attachment().swap(compressed); cntl->request_attachment().swap(compressed);
if (accessor.request_protocol() == PROTOCOL_GRPC) { if (cntl->request_protocol() == PROTOCOL_GRPC) {
grpc_compressed = true; grpc_compressed = true;
cntl->http_request().SetHeader(common->GRPC_ENCODING, common->GZIP); cntl->http_request().SetHeader(common->GRPC_ENCODING, common->GZIP);
} else { } else {
...@@ -563,7 +563,7 @@ void SerializeHttpRequest(butil::IOBuf* /*not used*/, ...@@ -563,7 +563,7 @@ void SerializeHttpRequest(butil::IOBuf* /*not used*/,
cntl->set_stream_creator(get_h2_global_stream_creator()); 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 // always tell client gzip support
// TODO(zhujiashun): add zlib and snappy? // TODO(zhujiashun): add zlib and snappy?
header->SetHeader(common->GRPC_ACCEPT_ENCODING, header->SetHeader(common->GRPC_ACCEPT_ENCODING,
......
...@@ -783,8 +783,6 @@ private: ...@@ -783,8 +783,6 @@ private:
butil::Mutex _stream_mutex; butil::Mutex _stream_mutex;
std::set<StreamId> *_stream_set; std::set<StreamId> *_stream_set;
SocketUniquePtr _agent_socket;
}; };
} // namespace brpc } // 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