~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/xmlrpc/client.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
 
269
269
 
270
270
= History
271
 
    $Id: client.rb 11816 2007-02-23 03:42:01Z knu $
 
271
    $Id: client.rb 13769 2007-10-24 20:00:10Z jeg2 $
272
272
 
273
273
=end
274
274
 
530
530
        }
531
531
      else
532
532
        # reuse the HTTP object for each call => connection alive is possible
 
533
        # we must start connection explicitely first time so that http.request
 
534
        # does not assume that we don't want keepalive
 
535
        @http.start if not @http.started?
533
536
        
534
537
        # post request
535
538
        resp = @http.post2(@path, request, header) 
549
552
      ct = parse_content_type(resp["Content-Type"]).first
550
553
      if ct != "text/xml"
551
554
        if ct == "text/html"
552
 
          raise "Wrong content-type: \n#{data}"
 
555
          raise "Wrong content-type (received '#{ct}' but expected 'text/xml'): \n#{data}"
553
556
        else
554
 
          raise "Wrong content-type"
 
557
          raise "Wrong content-type (received '#{ct}' but expected 'text/xml')"
555
558
        end
556
559
      end
557
560