about summary refs log tree commit homepage
path: root/lib/yahns/proxy_http_response.rb
diff options
context:
space:
mode:
authorEric Wong <bofh@yhbt.net>2022-12-22 09:02:10 +0000
committerEric Wong <e@yhbt.net>2022-12-22 09:02:51 +0000
commit17969a9a67ae8db7dbc227a8afbb220b94d08e7f (patch)
tree99ecc30f1144a7182507d4210de9cbe7a2031abd /lib/yahns/proxy_http_response.rb
parente263cc5a5771dfdeb6811f812d8b054e5404621f (diff)
downloadyahns-17969a9a67ae8db7dbc227a8afbb220b94d08e7f.tar.gz
This is the size used by Ruby internally for IO.copy_stream.
8192 seems too small nowadays with the higher cost of syscalls.
Diffstat (limited to 'lib/yahns/proxy_http_response.rb')
-rw-r--r--lib/yahns/proxy_http_response.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/yahns/proxy_http_response.rb b/lib/yahns/proxy_http_response.rb
index d4a3dda..db9c4b7 100644
--- a/lib/yahns/proxy_http_response.rb
+++ b/lib/yahns/proxy_http_response.rb
@@ -147,7 +147,7 @@ module Yahns::HttpResponse # :nodoc:
   end
 
   def read_len(len)
-    max = 0x2000
+    max = 16384
     max = len if len && len < max
     max
   end
@@ -206,7 +206,7 @@ module Yahns::HttpResponse # :nodoc:
     wbuf = req_res.resbuf
 
     until kcar.trailers(tlr, chunk)
-      case rv = req_res.kgio_tryread(0x2000, rbuf)
+      case rv = req_res.kgio_tryread(16384, rbuf)
       when String
         chunk << rv
       when :wait_readable