about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorIan Ownbey <ian@inspir.es>2009-01-31 22:10:56 -0800
committerIan Ownbey <ian@inspir.es>2009-01-31 22:10:56 -0800
commit77123838e7a6110e684353aea3443b2bffe7d731 (patch)
tree7d1315c01857ab0551eadf7a6f71984a5af328a9
parentfdf376b0da0032390c0e5dd0cf17b597231eba07 (diff)
parent108218a89c663af1c14cc6ff376464e71639f974 (diff)
downloadunicorn-77123838e7a6110e684353aea3443b2bffe7d731.tar.gz
* 'master' of git@github.com:fauna/mongrel:
  Clean up some logging.
-rw-r--r--ext/http11_java/org/jruby/mongrel/Http11.java4
-rw-r--r--lib/mongrel.rb12
-rw-r--r--lib/mongrel/http_request.rb5
3 files changed, 10 insertions, 11 deletions
diff --git a/ext/http11_java/org/jruby/mongrel/Http11.java b/ext/http11_java/org/jruby/mongrel/Http11.java
index 3dbfdd6..4ab5c7f 100644
--- a/ext/http11_java/org/jruby/mongrel/Http11.java
+++ b/ext/http11_java/org/jruby/mongrel/Http11.java
@@ -213,9 +213,9 @@ public class Http11 extends RubyObject {
                     }
                 }
 
-                req.setInstanceVariable("@http_body", RubyString.newString(runtime, new ByteList(hp.parser.buffer, at, length)));
+                req.aset(runtime.newString("http_body"),RubyString.newString(runtime, new ByteList(hp.parser.buffer, at, length)));
                 req.aset(runtime.newString("SERVER_PROTOCOL"),runtime.newString("HTTP/1.1"));
-                req.aset(runtime.newString("SERVER_SOFTWARE"),runtime.newString("Mongrel 1.2.0"));
+                req.aset(runtime.newString("SERVER_SOFTWARE"),runtime.newString("Mongrel 2.0"));
             }
         };
 
diff --git a/lib/mongrel.rb b/lib/mongrel.rb
index 39659a2..515ae2e 100644
--- a/lib/mongrel.rb
+++ b/lib/mongrel.rb
@@ -115,7 +115,7 @@ module Mongrel
             end
 
             raise "No REQUEST PATH" if !params[Const::REQUEST_PATH]
-
+
             params[Const::PATH_INFO] = params[Const::REQUEST_PATH]
             params[Const::SCRIPT_NAME] = Const::SLASH
 
@@ -149,12 +149,12 @@ module Mongrel
       rescue EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF
         client.close rescue nil
       rescue HttpParserError => e
-        logger.error "#HTTP parse error, malformed request (#{params[Const::HTTP_X_FORWARDED_FOR] || client.peeraddr.last}): #{e.inspect}"
-        logger.error "#REQUEST DATA: #{data.inspect}\n---\nPARAMS: #{params.inspect}\n---\n"
+        logger.error "HTTP parse error, malformed request (#{params[Const::HTTP_X_FORWARDED_FOR] || client.peeraddr.last}): #{e.inspect}"
+        logger.error "REQUEST DATA: #{data.inspect}\n---\nPARAMS: #{params.inspect}\n---\n"
       rescue Errno::EMFILE
         reap_dead_workers('too many files')
       rescue Object => e
-        logger.error "#Read error: #{e.inspect}"
+        logger.error "Read error: #{e.inspect}"
         logger.error e.backtrace.join("\n")
       ensure
         begin
@@ -162,7 +162,7 @@ module Mongrel
         rescue IOError
           # Already closed
         rescue Object => e
-          logger.error "#Client error: #{e.inspect}"
+          logger.error "Client error: #{e.inspect}"
           logger.error e.backtrace.join("\n")
         end
         request.body.close! if request and request.body.class == Tempfile
@@ -175,7 +175,7 @@ module Mongrel
     # after the reap is done.  It only runs if there are workers to reap.
     def reap_dead_workers(reason='unknown')
       if @workers.list.length > 0
-        logger.info "#Reaping #{@workers.list.length} threads for slow workers because of '#{reason}'"
+        logger.info "Reaping #{@workers.list.length} threads for slow workers because of '#{reason}'"
         error_msg = "Mongrel timed out this thread: #{reason}"
         mark = Time.now
         @workers.list.each do |worker|
diff --git a/lib/mongrel/http_request.rb b/lib/mongrel/http_request.rb
index 163268e..86c0e15 100644
--- a/lib/mongrel/http_request.rb
+++ b/lib/mongrel/http_request.rb
@@ -42,9 +42,8 @@ module Mongrel
       @body.rewind if @body
     end
 
-    # returns an environment which is rackable
-    # http://rack.rubyforge.org/doc/files/SPEC.html
-    # copied directly from racks mongrel handler
+    # Returns an environment which is rackable: http://rack.rubyforge.org/doc/files/SPEC.html
+    # Copied directly from Rack's old Mongrel handler.
     def env
       env = params.clone
       env["QUERY_STRING"] ||= ''