Changeset dab4d56 for fedd


Ignore:
Timestamp:
Nov 19, 2008 7:23:51 PM (16 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
c922f23
Parents:
f8582c9
Message:

Some correct response codes and importantly closing the sockets after each
connection, which was confusing the new python (2.5)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd.py

    rf8582c9 rdab4d56  
    107107        self.wfile.write(text)
    108108        self.wfile.flush()
     109        self.request.socket.close()
    109110
    110111    def send_fault(self, f, code=500):
    111112        """Send a SOAP encoded fault as reply"""
    112         print f
    113113        self.send_xml(f.AsSOAP(processContents="lax"), code)
    114114
     
    207207        self.wfile.write(text)
    208208        self.wfile.flush()
     209        # Make sure to close the socket when we're done
     210        self.request.socket.close()
    209211
    210212    def do_POST(self):
     
    214216        data = None
    215217        method = None
     218        code = 200
    216219        cl = int(self.headers['content-length'])
    217220        data = self.rfile.read(cl)
     
    222225            data = xmlrpclib.dumps(xmlrpclib.Fault("Client",
    223226                "Malformed request"), methodresponse=True)
    224        
     227            code = 500
     228
    225229        if method != None:
    226230            try:
     
    232236                data = xmlrpclib.dumps(f, methodresponse=True)
    233237                resp = None
    234         self.send_xml(data)
     238                code = 500
     239
     240        self.send_xml(data, code)
    235241
    236242    def log_request(self, code=0, size=0):
Note: See TracChangeset for help on using the changeset viewer.