Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 34 lines (29 sloc) 1.328 kB
157ab27 @wuxxin initial import
wuxxin authored
1 --- joshmarshall-jsonrpclib-283a2a9/jsonrpclib/jsonrpc.py 2010-09-10 09:14:38.000000000 +0200
2 +++ joshmarshall-jsonrpclib-283a2a9-ssl_patched/jsonrpclib/jsonrpc.py 2010-10-07 15:25:07.000000000 +0200
3 @@ -102,9 +102,8 @@ def jloads(json_string):
4 class ProtocolError(Exception):
5 pass
6
7 -class Transport(XMLTransport):
8 - """ Just extends the XMLRPC transport where necessary. """
9 - user_agent = config.user_agent
10 +class TransportMixIn:
11 + """ Common methods for both Transport and SafeTransport. """
12
13 def send_content(self, connection, request_body):
14 connection.putheader("Content-Type", "application/json-rpc")
15 @@ -127,11 +126,15 @@ class Transport(XMLTransport):
16 print 'body: %s' % response
17 return response_body
18
19 -class SafeTransport(XMLSafeTransport):
20 +class Transport(TransportMixIn, XMLTransport):
21 + """ Just extends the XMLRPC transport where necessary. """
22 + user_agent = config.user_agent
23 +
24 +class SafeTransport(TransportMixIn, XMLSafeTransport):
25 """ Just extends for HTTPS calls """
26 user_agent = Transport.user_agent
27 - send_content = Transport.send_content
28 - _parse_response = Transport._parse_response
29 + #send_content = Transport.send_content
30 + #_parse_response = Transport._parse_response
31
32 class ServerProxy(XMLServerProxy):
33 """
Something went wrong with that request. Please try again.