You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/10/12 09:40:58 UTC

[GitHub] [incubator-brpc] Aaaaaaron commented on a diff in pull request #1947: split large data when using brpc streaming

Aaaaaaron commented on code in PR #1947:
URL: https://github.com/apache/incubator-brpc/pull/1947#discussion_r993236302


##########
src/brpc/stream.cpp:
##########
@@ -140,20 +141,30 @@ ssize_t Stream::CutMessageIntoFileDescriptor(int /*fd*/,
         errno = EBADF;
         return -1;
     }
-    butil::IOBuf out;
     ssize_t len = 0;
     for (size_t i = 0; i < size; ++i) {
+      butil::IOBuf *data = data_list[i];
+      size_t length = data->length();
+      uint64_t trans_unit = FLAGS_max_trans_unit_size;
+      int packet_num = ceil((double)length / (double)trans_unit);

Review Comment:
   收到~



##########
src/brpc/stream.cpp:
##########
@@ -35,7 +35,8 @@
 namespace brpc {
 
 DECLARE_bool(usercode_in_pthread);
-
+DEFINE_uint64(max_trans_unit_size, 64 * 1024 * 1024,

Review Comment:
   收到~



-- 
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-unsubscribe@brpc.apache.org

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


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