From 48ccdcc868e65bbee3237da507325854d61378d4 Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Wed, 10 Mar 2021 08:58:25 +0530 Subject: [PATCH] increase buffer size --- p2phttp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p2phttp.go b/p2phttp.go index 0b1c930..cec65fe 100644 --- a/p2phttp.go +++ b/p2phttp.go @@ -51,6 +51,7 @@ import ( "net" "net/http" + "github.com/libp2p/go-libp2p-core/network" gostream "github.com/libp2p/go-libp2p-gostream" "github.com/libp2p/go-libp2p-core/host" @@ -150,7 +151,7 @@ func (rt *RoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { } }() - resp, err := http.ReadResponse(bufio.NewReader(conn), r) + resp, err := http.ReadResponse(bufio.NewReaderSize(conn, network.MessageSizeMax), r) if err != nil { return resp, err }