diff --git a/ChangeLog b/ChangeLog index 3d3b2a1fa1..2e0b573c3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Mon Jul 19 01:15:07 2004 GOTOU Yuuzou + + * lib/webrick/httpservlet/cgihandler.rb + (WEBrick::HTTPServlet::CGIhandler#do_GET): set SystemRoot environment + variable to CGI process on Windows native platforms. [ruby-dev:23936] + + * lib/webrick/httpservlet/cgihandler.rb + (WEBrick::HTTPServlet::CGIhandler#do_GET): use $?.exitstatus and + refine log message. + Sun Jul 18 16:14:29 2004 Hidetoshi NAGAI * ext/tk/lib/tk/msgcat.rb (TkMsgCatalog.callback): bug fix diff --git a/lib/webrick/httpservlet/cgihandler.rb b/lib/webrick/httpservlet/cgihandler.rb index aa92bb4a2c..7dd330ba7b 100644 --- a/lib/webrick/httpservlet/cgihandler.rb +++ b/lib/webrick/httpservlet/cgihandler.rb @@ -41,6 +41,9 @@ module WEBrick meta = req.meta_vars meta["SCRIPT_FILENAME"] = @script_filename meta["PATH"] = @config[:CGIPathEnv] + if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM + meta["SystemRoot"] = ENV["SystemRoot"] + end dump = Marshal.dump(meta) cgi_in.write("%8d" % cgi_out.path.size) @@ -55,8 +58,8 @@ module WEBrick end ensure cgi_in.close - status = $? >> 8 - sleep 0.1 if /mswin/ =~ RUBY_PLATFORM + status = $?.exitstatus + sleep 0.1 if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM data = cgi_out.read cgi_out.close(true) if errmsg = cgi_err.read @@ -74,7 +77,7 @@ module WEBrick data = "" unless data raw_header, body = data.split(/^[\xd\xa]+/on, 2) raise HTTPStatus::InternalServerError, - "The server encontered a script error." if body.nil? + "Premature end of script headers: #{@script_filename}" if body.nil? begin header = HTTPUtils::parse_header(raw_header)