about summary refs log tree commit homepage
path: root/lib/rainbows/http_response.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-19 10:09:48 +0000
committerEric Wong <normalperson@yhbt.net>2010-07-19 17:04:14 -0700
commit5ec57e5f5d7df07f563722a12d95845579e86e13 (patch)
treec2012a7a968d96786fb15d50185fc11468c92e1f /lib/rainbows/http_response.rb
parent399bbdb5c5e7cf9e716aacd9f0763813edf52423 (diff)
downloadrainbows-5ec57e5f5d7df07f563722a12d95845579e86e13.tar.gz
This will give each concurrency model more control over
particular code paths and serving static files.
Diffstat (limited to 'lib/rainbows/http_response.rb')
-rw-r--r--lib/rainbows/http_response.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/rainbows/http_response.rb b/lib/rainbows/http_response.rb
index ddab2f8..564d2d0 100644
--- a/lib/rainbows/http_response.rb
+++ b/lib/rainbows/http_response.rb
@@ -4,20 +4,19 @@
 # Cramp 0.11 relies on this, and is only activated by Cramp
 if defined?(Cramp) && defined?(Rainbows::EventMachine::Client)
   class Rainbows::HttpResponse
-    class << self
-      include Rainbows::Response
-      alias write write_response
+    # dummy method for Cramp to alias_method_chain
+    def self.write(client, response, out)
     end
   end
 
   module Rainbows::EventMachine::CrampSocket
-    def write_header(_, response, out)
+    def em_write_response(response, alive = false)
       if websocket?
         write web_socket_upgrade_data
         web_socket_handshake!
-        out = nil # disable response headers
+        response[1] = nil # disable response headers
       end
-      super(self, response, out)
+      super
     end
   end