--- nfo/projects/netfraggle/libs/xmlrpclib.py 2004/08/30 13:12:18 1.1 +++ nfo/projects/netfraggle/libs/xmlrpclib.py 2004/08/31 16:55:34 1.5 @@ -1,6 +1,6 @@ # # XML-RPC CLIENT LIBRARY -# $Id: xmlrpclib.py,v 1.1 2004/08/30 13:12:18 joko Exp $ +# $Id: xmlrpclib.py,v 1.5 2004/08/31 16:55:34 joko Exp $ # # an XML-RPC client interface for Python. # @@ -997,6 +997,10 @@ # client identifier (may be overridden) user_agent = "xmlrpclib.py/%s (by www.pythonware.com)" % __version__ + #def __init__(self): + #import xmlrpclib + #self.phpsessionid = "" + ## # Send a complete request, and parse the response. # @@ -1015,17 +1019,16 @@ self.send_request(h, handler, request_body) self.send_host(h, host) - self.send_php_sessionid(h, host) + self.send_php_sessionid(h) self.send_user_agent(h) self.send_content(h, request_body) - #errcode, errmsg, headers = h.getreply() response = h.getresponse() if response.status != 200: raise ProtocolError( host + handler, - response.status, response.reason + response.status, response.reason, {} ) self.verbose = verbose @@ -1035,8 +1038,8 @@ except AttributeError: sock = None - self.phpsessionid = response.getheader('Set-Cookie') - #print self.phpsessionid + import __main__ + __main__.phpsessionid = response.getheader('Set-Cookie') #return self._parse_response(h.getfile(), sock) return self._parse_response(response, None) @@ -1059,7 +1062,6 @@ def make_connection(self, host): # create a HTTP connection object from a host descriptor import httplib - #return httplib.HTTP(host) return httplib.HTTPConnection(host) ## @@ -1087,9 +1089,9 @@ # @param connection Connection handle. # @param host Host name. - def send_php_sessionid(self, connection, host): - connection.putheader("PHPSESSID", host) - #pass + def send_php_sessionid(self, connection): + import __main__ + connection.putheader("Cookie", str(__main__.phpsessionid)) ##