Pārlūkot izejas kodu

ensure write buffer size is enough

ithewei 3 gadi atpakaļ
vecāks
revīzija
a88bb2ec16
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      http/client/AsyncHttpClient.cpp

+ 4 - 0
http/client/AsyncHttpClient.cpp

@@ -159,6 +159,10 @@ int AsyncHttpClient::sendRequest(const SocketChannelPtr& channel) {
     char* data = NULL;
     size_t len = 0;
     while (ctx->parser->GetSendData(&data, &len)) {
+        // NOTE: ensure write buffer size is enough
+        if (len > (1 << 22) /* 4M */) {
+            channel->setMaxWriteBufsize(len);
+        }
         channel->write(data, len);
     }
     channel->startRead();