* [PATCH] fix broken constant lookups in unmaintained bits
@ 2015-11-24 23:05 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-11-24 23:05 UTC (permalink / raw)
To: rainbows-public
In case Revactor starts being maintained again...
(heck, it was probably the reason I started Rainbows! in the first
place...)
Our ReverseProxy stuff was never complete nor marketed;
and probably not worth keeping around at all.
---
lib/rainbows/revactor/client.rb | 2 +-
lib/rainbows/revactor/proxy.rb | 2 +-
lib/rainbows/reverse_proxy/coolio.rb | 6 +++---
lib/rainbows/reverse_proxy/event_machine.rb | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/rainbows/revactor/client.rb b/lib/rainbows/revactor/client.rb
index 5b1e52d..c24b137 100644
--- a/lib/rainbows/revactor/client.rb
+++ b/lib/rainbows/revactor/client.rb
@@ -32,7 +32,7 @@ def timed_read(buf2)
end
def set_input(env, hp)
- env[RACK_INPUT] = 0 == hp.content_length ?
+ env['rack.input'] = 0 == hp.content_length ?
NULL_IO : IC.new(@ts = TeeSocket.new(@client), hp)
end
diff --git a/lib/rainbows/revactor/proxy.rb b/lib/rainbows/revactor/proxy.rb
index 4715981..6bac7d5 100644
--- a/lib/rainbows/revactor/proxy.rb
+++ b/lib/rainbows/revactor/proxy.rb
@@ -22,7 +22,7 @@ def each
# (instead of Errno::EPIPE), so we need to limit the rescue
# to just readpartial and let EOFErrors during yield bubble up
begin
- buf = readpartial(INPUT_SIZE)
+ buf = readpartial(16384)
rescue EOFError
break
end while yield(buf) || true
diff --git a/lib/rainbows/reverse_proxy/coolio.rb b/lib/rainbows/reverse_proxy/coolio.rb
index 2a977e0..86f2b79 100644
--- a/lib/rainbows/reverse_proxy/coolio.rb
+++ b/lib/rainbows/reverse_proxy/coolio.rb
@@ -32,20 +32,20 @@ def on_readable
when :wait_readable
return
when nil
- @env[AsyncCallback].call(@response)
+ @env['async.callback'].call(@response)
return close
end while true # we always read until EAGAIN or EOF
rescue => e
case e
when Errno::ECONNRESET
- @env[AsyncCallback].call(@response)
+ @env['async.callback'].call(@response)
return close
when SystemCallError
else
Unicorn.log_error(@env["rack.logger"], "on_readable", e)
end
- @env[AsyncCallback].call(Rainbows::ReverseProxy::E502)
+ @env['async.callback'].call(Rainbows::ReverseProxy::E502)
close
end
end
diff --git a/lib/rainbows/reverse_proxy/event_machine.rb b/lib/rainbows/reverse_proxy/event_machine.rb
index 8cb382c..d92254d 100644
--- a/lib/rainbows/reverse_proxy/event_machine.rb
+++ b/lib/rainbows/reverse_proxy/event_machine.rb
@@ -30,7 +30,7 @@ def on_write_complete
end
def unbind
- @env[AsyncCallback].call(@response || Rainbows::ReverseProxy::E502)
+ @env['async.callback'].call(@response || Rainbows::ReverseProxy::E502)
end
end
--
EW
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-24 23:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24 23:05 [PATCH] fix broken constant lookups in unmaintained bits Eric Wong
Rainbows! Rack HTTP server user/dev discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://yhbt.net/rainbows-public
git clone --mirror http://ou63pmih66umazou.onion/rainbows-public
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V1 rainbows-public rainbows-public/ https://yhbt.net/rainbows-public \
rainbows-public@yhbt.net rainbows-public@bogomips.org rainbows-talk@rubyforge.org rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
public-inbox-index rainbows-public
Example config snippet for mirrors.
Newsgroups are available over NNTP:
nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows
note: .onion URLs require Tor: https://www.torproject.org/
code repositories for project(s) associated with this inbox:
../../../rainbows.git
AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git