This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Gemfile b/Gemfile | |
index 3e1c3e6..2a45190 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -20,6 +20,8 @@ gem "system_timer", "1.0" | |
gem "will_paginate", "3.0.pre2" | |
gem "xml-simple", "1.0.12" | |
+gem "memprof", "0.3.10.beta.1" | |
+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/code/rbtrace (master*) % cat server.rb | |
require 'rbtrace' | |
while true | |
Dir.chdir("/tmp") do | |
sleep rand*0.5 | |
end | |
end | |
~/code/rbtrace (master*) % ruby server.rb & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'eventmachine' | |
module ProxyConnection | |
def initialize(client) | |
@client = client | |
end | |
def post_init | |
proxy_incoming_to(@client) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyHttpConnection | |
def connection_completed | |
@parser = Http::Parser.new(self) | |
end | |
def receive_data(data) | |
@parser << data | |
unless @headers_done | |
@raw_headers << data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Gemfile b/Gemfile | |
index c0358ae..f25380e 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -1,14 +1,29 @@ | |
-source :gemcutter | |
+source :rubygems | |
-gem 'eventmachine', '~> 0.12.9' | |
+gem 'eventmachine', '~> 0.12.11' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load balancing | |
# send incoming requests to one of 10 backends running on ports 5000-5009 | |
HttpProxyMachine.start do | |
{ :host => 'localhost', :port => 5000 + rand(10) } | |
end | |
# host based routing | |
# send requests for media.server/file to localhost:3000/media/file | |
# all other requests are unmodified | |
HttpProxyMachine.start do |request| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby -v | |
jruby 1.5.3 (ruby 1.8.7 patchlevel 249) (2010-09-28 7ca06d7) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [x86_64-java] | |
$ ruby -e' require "lib/http11.jar"; p Mongrel ' | |
-e:1: uninitialized constant Mongrel (NameError) | |
$ ruby -I lib -e' require "http11.jar"; p Mongrel ' | |
Mongrel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- mongrel/ext/http11/http11_parser_common.rl 2010-10-13 01:08:57.000000000 -0700 | |
+++ thin/ext/thin_parser/common.rl 2010-06-18 18:36:01.000000000 -0700 | |
@@ -11,11 +11,12 @@ | |
safe = ("$" | "-" | "_" | "."); | |
extra = ("!" | "*" | "'" | "(" | ")" | ","); | |
reserved = (";" | "/" | "?" | ":" | "@" | "&" | "=" | "+"); | |
- unsafe = (CTL | " " | "\"" | "#" | "%" | "<" | ">"); | |
+ sorta_safe = ("\"" | "<" | ">"); | |
+ unsafe = (CTL | " " | "#" | "%" | sorta_safe); | |
national = any -- (alpha | digit | reserved | extra | safe | unsafe); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /tmp/http11.c 2010-10-13 01:16:03.000000000 -0700 | |
+++ /tmp/thin.c 2010-10-13 01:16:14.000000000 -0700 | |
@@ -1,22 +1,22 @@ | |
/** | |
- * Copyright (c) 2005 Zed A. Shaw | |
+ * Mongrel Parser adpated to Thin and to play more nicely with Rack specs. | |
+ * | |
+ * Orignal version Copyright (c) 2005 Zed A. Shaw | |
* You can redistribute it and/or modify it under the same terms as Ruby. | |
*/ |