macournoyer / thin
- Source
- Commits
- Network (36)
- Issues (5)
- Downloads (17)
- Wiki (1)
- Graphs
-
Branch:
master
-
pull in this commit http://github.com/ryanschwartz/thin/commit/be8f9755d3313265bd714a59b27934ec5dc1b988
Comments
-
Thin cuts PATH_INFO after finding ";" (it shouldn't)
2 comments Created about 1 month ago by ibcIf Thin receives a request with request line:
GET /level1/level2;user=alice/level3/doc.txt HTTP/1.1
then Thin cuts the URI path and leaves:
env{"PATH_INFO"} => "/level1/level2"
Why? I've looked for such behavior in RFC 3986 and RFC 2616 but I don't find a reason to remove all the path content after ";".
Is there any reason I miss? I've tryed other http servers running with Rack and the don't cut it.
Regards.
Comments
macournoyer
Tue Nov 24 08:19:12 -0800 2009
| link
the env object is constructed according to Rack specs: http://rack.rubyforge.org/doc/SPEC.html
If you want the full URI look into env["REQUEST_URI"]
I've confirmed rught now that Mongrel also removes the text after ";" in PATH_INFO (but Webrick doesn't remove it).
I'll open a bug in Rack. However could you please point me where in Rack SPEC is documented that PATH_INFO should end before the first ";" ? I don't read it in the specs.
Thanks a lot.
-
[Again] Thin shouldn't cut PATH_INFO after a semicolon
5 comments Created about 1 month ago by ibcI reported this possible bug but it was closed:
http://github.com/macournoyer/thin/issues/closed#issue/6Please before closing it read the thread I open in Rack maillist:
http://groups.google.com/group/rack-devel/browse_thread/thread/f48d0f995357a3deIf you close this report agains please tell me where exactly Rack SPECS state that PATH_INFO must be cut after a semicolon.
Regards.
Comments
macournoyer
Mon Nov 30 18:02:06 -0800 2009
| link
According to http://www.python.org/dev/peps/pep-0333/#url-reconstruction I think you're right, it looks like an issue in the parser, which is the same as Mongrel.
As workaround for now, you can create a Rack middleware to reconstruct PATH_INFO using REQUEST_URI before calling the app.
Please take a look to this mail into Rack-devel ML as Unicorn developer has fixed this bug for Unicorn:
http://groups.google.com/group/rack-devel/msg/6ced64b632714068
It's just this line into the Ragel grammar:
- rel_path = ( path? %request_path (";" params)? ) ("?" %start_query query)?;
- rel_path = (path? (";" params)? %request_path) ("?" %start_query query)?;
I've posted the bug in Mongrel tracker:
macournoyer
Mon Dec 07 07:17:23 -0800 2009
| link
I pushed the fix http://github.com/macournoyer/thin/commit/2e9db13e414ae742593744f4b8682d5104ba9c4b
thx
-
When I run rackup specifying the -s thin I get a segfault answering a request. Same thing with /usr/local/bin/thin -R config.ru start.
fmueller:/opt/ext/snippy[experimental*]$ /usr/local/bin/rackup config.ru -s thin >> Thin web server (v1.2.2 codename I Find Your Lack of Sauce Disturbing) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:9292, CTRL+C to stop /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/request.rb:50: [BUG] unknown type 0x22 (0xc given) ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-darwin9.7.0] -- control frame ---------- c:0023 p:---- s:0091 b:0091 l:000090 d:000090 CFUNC :initialize c:0022 p:---- s:0089 b:0089 l:000088 d:000088 CFUNC :new c:0021 p:0019 s:0086 b:0086 l:000085 d:000085 METHOD /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/request.rb:50 c:0020 p:---- s:0083 b:0083 l:000082 d:000082 FINISH c:0019 p:---- s:0081 b:0081 l:000080 d:000080 CFUNC :new c:0018 p:0017 s:0078 b:0078 l:000077 d:000077 METHOD /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/connection.rb:35 c:0017 p:0042 s:0075 b:0075 l:000067 d:000074 BLOCK /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/em/connection.rb:43 c:0016 p:---- s:0073 b:0073 l:000072 d:000072 FINISH c:0015 p:---- s:0071 b:0071 l:000070 d:000070 CFUNC :instance_eval c:0014 p:0017 s:0068 b:0068 l:000067 d:000067 METHOD /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/em/connection.rb:36 c:0013 p:0156 s:0063 b:0063 l:000062 d:000062 METHOD /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/eventmachine.rb:1490 c:0012 p:---- s:0052 b:0052 l:000051 d:000051 FINISH c:0011 p:---- s:0050 b:0050 l:000049 d:000049 CFUNC :run_machine c:0010 p:0212 s:0047 b:0047 l:000046 d:000046 METHOD /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/eventmachine.rb:242 c:0009 p:0065 s:0040 b:0040 l:000e68 d:000e68 METHOD /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/backends/base.rb:57 c:0008 p:0139 s:0036 b:0036 l:000035 d:000035 METHOD /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/server.rb:156 c:0007 p:0115 s:0033 b:0033 l:000032 d:000032 METHOD /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler/thin.rb:14 c:0006 p:0897 s:0027 b:0027 l:001a14 d:001a14 TOP /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/bin/rackup:176 c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :load c:0003 p:0109 s:0007 b:0007 l:001b74 d:000ee8 EVAL /usr/local/bin/rackup:19 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:001b74 d:001b74 TOP :47140 --------------------------- -- Ruby level backtrace information----------------------------------------- /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/request.rb:50:in `initialize' /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/request.rb:50:in `new' /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/request.rb:50:in `initialize' /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/connection.rb:35:in `new' /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/connection.rb:35:in `post_init' /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/em/connection.rb:43:in `block in new' /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/em/connection.rb:36:in `instance_eval' /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/em/connection.rb:36:in `new' /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/eventmachine.rb:1490:in `event_callback' /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in `run_machine' /usr/local/lib/ruby1.9/gems/1.9.1/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in `run' /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/backends/base.rb:57:in `start' /usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/server.rb:156:in `start' /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler/thin.rb:14:in `run' /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/bin/rackup:176:in `' /usr/local/bin/rackup:19:in `load' /usr/local/bin/rackup:19:in `' -- C level backtrace information ------------------------------------------- 0x2f7e02 0 libruby1.9.dylib 0x002f7e02 rb_vm_bugreport + 82 0x20ce3c 1 libruby1.9.dylib 0x0020ce3c rb_warning + 444 0x20ce9b 2 libruby1.9.dylib 0x0020ce9b rb_bug + 43 0x20f6d3 3 libruby1.9.dylib 0x0020f6d3 rb_check_type + 387 0x14c6a8d 4 thin_parser.bundle 0x014c6a8d Thin_HttpParser_init + 39 0x2f0b89 5 libruby1.9.dylib 0x002f0b89 rb_f_eval + 697 0x2f12db 6 libruby1.9.dylib 0x002f12db rb_funcall2 + 283 0x210aeb 7 libruby1.9.dylib 0x00210aeb rb_obj_call_init + 75 0x24562a 8 libruby1.9.dylib 0x0024562a rb_class_new_instance + 42 0x2e3605 9 libruby1.9.dylib 0x002e3605 rb_iseq_compile + 1125 0x2e7c6d 10 libruby1.9.dylib 0x002e7c6d rb_raise_method_missing + 1037 0x2ea47b 11 libruby1.9.dylib 0x002ea47b rb_raise_method_missing + 11291 0x2ef8fb 12 libruby1.9.dylib 0x002ef8fb rb_raise_method_missing + 32923 0x2f0dec 13 libruby1.9.dylib 0x002f0dec rb_f_eval + 1308 0x2f12db 14 libruby1.9.dylib 0x002f12db rb_funcall2 + 283 0x210aeb 15 libruby1.9.dylib 0x00210aeb rb_obj_call_init + 75 0x24562a 16 libruby1.9.dylib 0x0024562a rb_class_new_instance + 42 0x2e3605 17 libruby1.9.dylib 0x002e3605 rb_iseq_compile + 1125 0x2e7c6d 18 libruby1.9.dylib 0x002e7c6d rb_raise_method_missing + 1037 0x2ea47b 19 libruby1.9.dylib 0x002ea47b rb_raise_method_missing + 11291 0x2ef8fb 20 libruby1.9.dylib 0x002ef8fb rb_raise_method_missing + 32923 0x2f3e68 21 libruby1.9.dylib 0x002f3e68 rb_yield + 2168 0x2f432d 22 libruby1.9.dylib 0x002f432d rb_mod_module_exec + 109 0x2e3605 23 libruby1.9.dylib 0x002e3605 rb_iseq_compile + 1125 0x2e7c6d 24 libruby1.9.dylib 0x002e7c6d rb_raise_method_missing + 1037 0x2ea47b 25 libruby1.9.dylib 0x002ea47b rb_raise_method_missing + 11291 0x2ef8fb 26 libruby1.9.dylib 0x002ef8fb rb_raise_method_missing + 32923 0x2f0dec 27 libruby1.9.dylib 0x002f0dec rb_f_eval + 1308 0x2e7529 28 libruby1.9.dylib 0x002e7529 rb_funcall + 345 0x1185ff1 29 rubyeventmachine.bundle 0x01185ff1 _ZNSt11_Deque_baseIN14PipeDescriptor12OutboundPageESaIS1_EED2Ev + 273 0x118644c 30 rubyeventmachine.bundle 0x0118644c _ZNSt11_Deque_baseIN14PipeDescriptor12OutboundPageESaIS1_EED2Ev + 1388 0x117bd61 31 rubyeventmachine.bundle 0x0117bd61 _ZN18AcceptorDescriptor4ReadEv + 273 0x117eb58 32 rubyeventmachine.bundle 0x0117eb58 _ZN14EventMachine_t14_RunSelectOnceEv + 520 0x1182313 33 rubyeventmachine.bundle 0x01182313 _ZN14EventMachine_t8_RunOnceEv + 35 0x118239c 34 rubyeventmachine.bundle 0x0118239c _ZN14EventMachine_t3RunEv + 92 0x11744c9 35 rubyeventmachine.bundle 0x011744c9 evma_run_machine + 41 0x11864cb 36 rubyeventmachine.bundle 0x011864cb _ZNSt11_Deque_baseIN14PipeDescriptor12OutboundPageESaIS1_EED2Ev + 1515 0x2e7c6d 37 libruby1.9.dylib 0x002e7c6d rb_raise_method_missing + 1037 0x2ea47b 38 libruby1.9.dylib 0x002ea47b rb_raise_method_missing + 11291 0x2ef8fb 39 libruby1.9.dylib 0x002ef8fb rb_raise_method_missing + 32923 0x2efc38 40 libruby1.9.dylib 0x002efc38 rb_iseq_eval + 264 0x213629 41 libruby1.9.dylib 0x00213629 rb_load + 345 0x213762 42 libruby1.9.dylib 0x00213762 rb_load + 658 0x2e3605 43 libruby1.9.dylib 0x002e3605 rb_iseq_compile + 1125 0x2e7c6d 44 libruby1.9.dylib 0x002e7c6d rb_raise_method_missing + 1037 0x2ea47b 45 libruby1.9.dylib 0x002ea47b rb_raise_method_missing + 11291 0x2ef8fb 46 libruby1.9.dylib 0x002ef8fb rb_raise_method_missing + 32923 0x2efb0f 47 libruby1.9.dylib 0x002efb0f rb_iseq_eval_main + 159 0x20ff99 48 libruby1.9.dylib 0x0020ff99 ruby_exec_node + 169 0x2125fe 49 libruby1.9.dylib 0x002125fe ruby_run_node + 94 0x1fef 50 ruby1.9 0x00001fef main + 95 0x1f56 51 ruby1.9 0x00001f56 start + 54 [NOTE] You may encounter a bug of Ruby interpreter. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html Abort trap
Comments
-
can macournoyer-thin dependent on eventmachine-eventmachine?
0 comments Created 6 months ago by phoenixThe version of eventmachine-eventmachine is newer than eventmachine on rubyforge sometimes,but after I installed eventmachine-eventmachine,thin can't use it.Is it possible that thin dependents on eventmachine,and macournoyer-thin dependents on eventmachine-eventmachine?
Comments
-
Ruby 1.9 and Thin (config.ru and Rack::File)
2 comments Created about 1 month ago by documentcloudIt looks like when Thin uses a config.ru under Ruby 1.9, it evaluates it under the Rack module, which breaks code that relies on the top-level File, instead of Rack::File. See:
http://github.com/documentcloud/cloud-crowd/issues/closed#issue/6
If this is really a problem with Rack/Ruby1.9, instead of Thin, feel free to close the ticket.
Comments
macournoyer
Tue Nov 10 07:06:54 -0800 2009
| link
Same behaviour in Rack's rackup command line tool.
This event looks like a constant lookup issue in 1.9.
Works find in 1.8. I'll try to figure out a fix, let me know if you find one.See this:
http://coderrr.wordpress.com/2009/06/02/fixing-constant-lookup-in-dsls-in-ruby-1-9/My workaround is using full module path (::File instead of File).
-
When using request absolute URI Thin leaves PATH_INFO empty
2 comments Created 18 days ago by ibcI'm testing Rack with Thin 1.2.5 using both HTTP queries with relative URI and absolute URI.
I use map "/" in my Rack builder so it gets any request.However when I get the value of env["PATH_INFO"] I get an empty string when using absolute URI:
a) Relative URI:
GET /pres-rules/mydoc.xml HTTP/1.1
=> env['PATH_INFO'] = "/pres-rules/mydoc.xml"
b) Absolute URI:
GET http://127.0.0.1:9292/pres-rules/mydoc.xml HTTP/1.1
=> env['PATH_INFO'] = ""
This doesn't occur using webrick.
PS: As per RFC 2616 (HTTP/1.1) a HTTP request allows absolute request uri:
http://tools.ietf.org/html/rfc2616#section-5.1.2GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1Comments
macournoyer
Tue Dec 15 19:52:32 -0800 2009
| link
Indeed, it's a known bug (or unsupported feature if you will). Web browsers never use absolute urls so it's an edge case. Why are you sending this request?
Thanks for the response. I don't use Thin for web applications but for XCAP (RFC 4825) which is XPath over HTTP (more or less). It's still a new protocol and I don't know if vendors will implement relative or absolute URI's in the HTTP requests (I expect they will always use relative uri however).
So I have seen no http client using absolute uri yet.





