about summary refs log tree commit homepage
path: root/lib/yahns/http_response.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-30 01:50:17 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-30 07:01:01 +0000
commit61f325506c699292bf6ec7982ab824bc375ca03f (patch)
tree2a3412f24e538966bcc07a3eb649de93591baeb6 /lib/yahns/http_response.rb
parent666d1936c72ae73b9f02d73000015135cdc4a716 (diff)
downloadyahns-61f325506c699292bf6ec7982ab824bc375ca03f.tar.gz
This saves about 200 bytes of unswappable kernel memory,
so it might matter for systems with many connections
when hijacking.
Diffstat (limited to 'lib/yahns/http_response.rb')
-rw-r--r--lib/yahns/http_response.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/yahns/http_response.rb b/lib/yahns/http_response.rb
index 6b97038..6ddb1c8 100644
--- a/lib/yahns/http_response.rb
+++ b/lib/yahns/http_response.rb
@@ -146,10 +146,7 @@ module Yahns::HttpResponse # :nodoc:
       end while true
     end
 
-    if hijack
-      hijack.call(self)
-      return :ignore
-    end
+    return response_hijacked(hijack) if hijack
 
     if body.respond_to?(:to_path)
       @state = body = Yahns::StreamFile.new(body, alive, offset, count)