about summary refs log tree commit homepage
path: root/lib/yahns/http_client.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/http_client.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/http_client.rb')
-rw-r--r--lib/yahns/http_client.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb
index b6b6035..826eb8d 100644
--- a/lib/yahns/http_client.rb
+++ b/lib/yahns/http_client.rb
@@ -315,7 +315,7 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc:
   end
 
   def do_pread(io, count, offset)
-    count = 0x4000 if count > 0x4000
+    count = 16384 if count > 16384
     buf = Thread.current[:yahns_sfbuf] ||= ''.dup
     if io.respond_to?(:pread)
       io.pread(count, offset, buf)