wwbmmm commented on a change in pull request #1690:
URL: https://github.com/apache/incubator-brpc/pull/1690#discussion_r800405494



##########
File path: src/brpc/policy/http_rpc_protocol.cpp
##########
@@ -513,6 +522,12 @@ void SerializeHttpRequest(butil::IOBuf* /*not used*/,
                 return cntl->SetFailed(EREQUEST, "Fail to serialize %s",
                                        pbreq->GetTypeName().c_str());
             }
+        } else if (content_type == HTTP_CONTENT_PROTO_TEXT) {
+            if (!google::protobuf::TextFormat::Print(*pbreq, &wrapper)) {
+                cntl->request_attachment().clear();
+                return cntl->SetFailed(EREQUEST, "Fail to print %s",

Review comment:
       Fail to print %s as proto-text

##########
File path: src/brpc/policy/http_rpc_protocol.cpp
##########
@@ -1470,6 +1489,12 @@ void ProcessHttpRequest(InputMessageBase *msg) {
                                     req->GetDescriptor()->full_name().c_str());
                     return;
                 }
+            } else if (content_type == HTTP_CONTENT_PROTO_TEXT) {
+                if (!ParsePbTextFromIOBuf(req, req_body)) {
+                    cntl->SetFailed(EREQUEST, "Fail to parse http body as %s",

Review comment:
       Fail to parse http proto-text body as %s

##########
File path: src/brpc/policy/http_rpc_protocol.cpp
##########
@@ -757,6 +772,10 @@ HttpResponseSender::~HttpResponseSender() {
             if (!res->SerializeToZeroCopyStream(&wrapper)) {
                 cntl->SetFailed(ERESPONSE, "Fail to serialize %s", 
res->GetTypeName().c_str());
             }
+        } else if (content_type == HTTP_CONTENT_PROTO_TEXT) {
+            if (!google::protobuf::TextFormat::Print(*res, &wrapper)) {
+                cntl->SetFailed(ERESPONSE, "Fail to print %s", 
res->GetTypeName().c_str());

Review comment:
       Fail to print %s as proto-text




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to