zyearn commented on a change in pull request #1529:
URL: https://github.com/apache/incubator-brpc/pull/1529#discussion_r696948155



##########
File path: src/brpc/channel.cpp
##########
@@ -386,6 +413,12 @@ void Channel::CallMethod(const 
google::protobuf::MethodDescriptor* method,
         CHECK(cntl->protocol_param().empty());
         cntl->protocol_param() = _options.protocol.param();
     }
+    if (_options.protocol == brpc::PROTOCOL_HTTP) {
+        const URI& uri = cntl->http_request().uri();
+        if (uri.host().empty() && !_hostname.empty()) {
+            const_cast<URI&>(uri).set_host(_hostname);

Review comment:
       这里直接拿到mutable uri就不需要const转化了吧?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to