You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2024/05/30 05:04:49 UTC

(opendal) branch try-debug created (now e2b5df1c36)

This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a change to branch try-debug
in repository https://gitbox.apache.org/repos/asf/opendal.git


      at e2b5df1c36 debug: try don't reuse bytes from hyper

This branch includes the following new commits:

     new e2b5df1c36 debug: try don't reuse bytes from hyper

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(opendal) 01/01: debug: try don't reuse bytes from hyper

Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch try-debug
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit e2b5df1c3644a6ec678182d337910624e7baeaa6
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Thu May 30 13:04:30 2024 +0800

    debug: try don't reuse bytes from hyper
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
 core/src/raw/http_util/client.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/core/src/raw/http_util/client.rs b/core/src/raw/http_util/client.rs
index 4ecd743ead..aecc19a740 100644
--- a/core/src/raw/http_util/client.rs
+++ b/core/src/raw/http_util/client.rs
@@ -140,6 +140,8 @@ impl HttpClient {
 
         let bs: Vec<Bytes> = resp
             .bytes_stream()
+            // DEBUG: try don't reuse bytes from hyper, keep it's internal buffer size low.
+            .map_ok(|v| Bytes::copy_from_slice(&v))
             .try_filter(|v| future::ready(!v.is_empty()))
             .try_collect()
             .await