about summary refs log tree commit homepage
path: root/lib/yahns/openssl_client.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-07-16 11:46:20 +0000
committerEric Wong <e@80x24.org>2018-08-05 20:14:56 +0000
commit335a8321dc31a165676fb21f5464b7a11a37ce75 (patch)
treeb325e2fabc5eea18529cde2642707e3d847e7771 /lib/yahns/openssl_client.rb
parentb4b5ce761a3ea777cf07bd8d4c9c4c17958c12ae (diff)
downloadyahns-335a8321dc31a165676fb21f5464b7a11a37ce75.tar.gz
In the future, this will allow sharing open files across
different clients when serving static files.  For now, it
saves us one syscall.
Diffstat (limited to 'lib/yahns/openssl_client.rb')
-rw-r--r--lib/yahns/openssl_client.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/yahns/openssl_client.rb b/lib/yahns/openssl_client.rb
index c090083..d3caacb 100644
--- a/lib/yahns/openssl_client.rb
+++ b/lib/yahns/openssl_client.rb
@@ -93,10 +93,7 @@ module Yahns::OpenSSLClient # :nodoc:
 
     case buf = @ssl_blocked
     when nil
-      count = 0x4000 if count > 0x4000
-      buf = Thread.current[:yahns_sfbuf] ||= ''.dup
-      io.pos = offset
-      buf = io.read(count, buf) or return # nil for EOF
+      buf = do_pread(io, count, offset) or return # nil for EOF
       buf = @ssl_blocked = buf.dup
     when Exception
       raise buf