From 777681bda1fe3fbc33bd2c3d4ce132e6b8c0042e Mon Sep 17 00:00:00 2001 From: mneumann Date: Tue, 7 Oct 2003 11:22:16 +0000 Subject: [PATCH] applied patch by OHARA Shigeki: * use Apache::Request#headers_in instead of obsolete #headers methods * XMLRPC::ModRubyServer::new is no longer a singleton method git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/xmlrpc/server.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/xmlrpc/server.rb b/lib/xmlrpc/server.rb index f5d8059912..0fabd3861e 100644 --- a/lib/xmlrpc/server.rb +++ b/lib/xmlrpc/server.rb @@ -509,22 +509,16 @@ Use it in the same way as CGIServer! =end class ModRubyServer < BasicServer - @@obj = nil - - def ModRubyServer.new(*a) - @@obj = super(*a) if @@obj.nil? - @@obj - end def initialize(*a) @ap = Apache::request super(*a) end - + def serve catch(:exit_serve) { header = {} - @ap.each_header {|key, value| header[key.capitalize] = value} + @ap.headers_in.each {|key, value| header[key.capitalize] = value} length = header['Content-length'].to_i @@ -569,7 +563,7 @@ class ModRubyServer < BasicServer h['Status'] ||= "200 OK" h['Content-length'] ||= body.size.to_s - h.each {|key, value| @ap[key] = value } + h.each {|key, value| @ap.headers_out[key] = value } @ap.content_type = h["Content-type"] @ap.status = status.to_i @ap.send_http_header