Skip to content

Commit

Permalink
applied patch by OHARA Shigeki:
Browse files Browse the repository at this point in the history
  * 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
  • Loading branch information
mneumann committed Oct 7, 2003
1 parent 885ea0a commit 777681b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/xmlrpc/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -509,22 +509,16 @@ def http_write(body, header)
=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

Expand Down Expand Up @@ -569,7 +563,7 @@ def http_write(body, status, header)
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
Expand Down

0 comments on commit 777681b

Please sign in to comment.