ia64/xen-unstable

changeset 10509:dab24595e529

[TOOLS] Make sure to explicitly close the connection if we're using HTTP/1.0. This
shouldn't be needed but it appears to be necessary as the Python client
just does a wfile.read() instead of only reading the reported Content-Length.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jun 22 15:10:48 2006 +0100 (2006-06-22)
parents c2e8e9b1e192
children e6ec0eeabf77
files tools/python/xen/util/xmlrpclib2.py
line diff
     1.1 --- a/tools/python/xen/util/xmlrpclib2.py	Thu Jun 22 15:09:48 2006 +0100
     1.2 +++ b/tools/python/xen/util/xmlrpclib2.py	Thu Jun 22 15:10:48 2006 +0100
     1.3 @@ -58,8 +58,6 @@ class XMLRPCRequestHandler(SimpleXMLRPCR
     1.4      #    propagate so that it shows up in the Xend debug logs
     1.5      # 2) we don't bother checking for a _dispatch function since we don't
     1.6      #    use one
     1.7 -    # 3) we never shutdown the connection.  This appears to be a bug in
     1.8 -    #    SimpleXMLRPCServer.py as it breaks HTTP Keep-Alive
     1.9      def do_POST(self):
    1.10          data = self.rfile.read(int(self.headers["content-length"]))
    1.11          rsp = self.server._marshaled_dispatch(data)
    1.12 @@ -71,6 +69,8 @@ class XMLRPCRequestHandler(SimpleXMLRPCR
    1.13  
    1.14          self.wfile.write(rsp)
    1.15          self.wfile.flush()
    1.16 +        if self.close_connection == 1:
    1.17 +            self.connection.shutdown(1)
    1.18  
    1.19  class HTTPUnixConnection(HTTPConnection):
    1.20      def connect(self):