#831: Received request header with Webrick HTTPD is broken after GC is executed. ----------------------------------+----------------------------------------- Reporter: watson1...@… | Owner: lsansone...@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ #!ruby $ cat test.rb require 'open-uri' require 'webrick'
NullLog = Object.new def NullLog.<<(arg) end def with_http Dir.mktmpdir {|dr| srv = WEBrick::HTTPServer.new({ :DocumentRoot => dr, :ServerType => Thread, :Logger => WEBrick::Log.new(NullLog), :AccessLog => [[NullLog, ""]], :BindAddress => '127.0.0.1', :Port => 8080}) _, port, _, host = srv.listeners[0].addr begin th = srv.start yield srv, dr, "http://#{host}:#{port}" ensure srv.shutdown end } end myheader1 = 'hello world' myheader2 = nil with_http {|srv, dr, url| srv.mount_proc("/h/") {|req, res| myheader2 = req['myheader']; p "recv [1] : before GC : #{myheader2}" GC.start p "recv [2] : after GC : #{myheader2}" res.body = "foo" } open("#{url}/h/", 'MyHeader'=>myheader1) {|f| } } }}} GC Eabled: {{{ $ macruby test.rb "recv [1] : before GC : hello world" "recv [2] : after GC : \xA1i\x00\x00\x00\x00\x00\x00\xE0n)" }}} GC Disabled: {{{ $ GC_DISABLE=true macruby test.rb "recv [1] : before GC : hello world" "recv [2] : after GC : hello world" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/831> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel