• Home
  • Raw
  • Download

Lines Matching +full:x +full:- +full:forwarded +full:- +full:for

1 r"""Simple XML-RPC Server.
3 This module can be used to create simple XML-RPC servers
8 It can also be used to handle XML-RPC requests in a CGI
17 server.register_function(lambda x,y: x+y, 'add')
32 ['string.' + method for method in list_public_methods(self.string)]
33 def pow(self, x, y): return pow(x, y)
34 def add(self, x, y) : return x + y
45 # this method must be present for system.listMethods
49 # this method must be present for system.methodHelp
54 return "pow(x, y[, z]) => number"
78 # callable through XML-RPC to prevent potential security
86 def export_add(self, x, y):
87 return x + y
130 for i in attrs:
143 return [member for member in dir(obj)
155 for x in lst:
156 u[x] = 1
161 """Mix-in class that dispatches XML-RPC requests.
163 This class is used to register XML-RPC method handlers
176 """Registers an instance to respond to XML-RPC requests.
181 method will be called with the name of the XML-RPC method and
191 If a registered function matches an XML-RPC request, then it
212 """Registers a function to respond to XML-RPC requests.
215 for the function.
223 """Registers the XML-RPC introspection methods in the system
234 """Registers the XML-RPC multicall method in the system
242 """Dispatches an XML-RPC method from marshalled (XML) data.
244 XML-RPC methods are dispatched from the marshalled (XML) data
246 marshalled data. For backwards compatibility, a dispatch
317 Returns a string containing documentation for the specified method."""
323 # Instance can implement _methodHelp to return help for a method
350 Allows the caller to package multiple XML-RPC calls into a single
357 for call in call_list:
379 """Dispatches the XML-RPC method.
381 XML-RPC calls are forwarded to a registered function that
382 matches the called XML-RPC method name. If no such function
383 exists then the call is forwarded to the registered instance,
387 method will be called with the name of the XML-RPC method and
405 # check for a _dispatch method
425 """Simple XML-RPC request handler class.
428 XML-RPC requests.
440 wbufsize = -1
443 # a re to match a gzip Accept-Encoding
445 \s* ([^\s;]+) \s* #content-coding
446 (;\s* q \s*=\s* ([0-9\.]+))? #q
451 ae = self.headers.get("Accept-Encoding", "")
452 for e in ae.split(","):
470 Attempts to interpret all HTTP POST requests as XML-RPC calls,
471 which are forwarded to the server's _dispatch method for handling.
485 size_remaining = int(self.headers["content-length"])
493 size_remaining -= len(L[-1])
515 self.send_header("X-exception", str(e))
516 self.send_header("X-traceback", traceback.format_exc())
518 self.send_header("Content-length", "0")
523 self.send_header("Content-type", "text/xml")
530 self.send_header("Content-Encoding", "gzip")
533 self.send_header("Content-length", str(len(response)))
539 encoding = self.headers.get("content-encoding", "identity").lower()
551 self.send_header("Content-length", "0")
558 self.send_header("Content-type", "text/plain")
559 self.send_header("Content-length", str(len(response)))
563 def log_request(self, code='-', size='-'):
571 """Simple XML-RPC server.
573 Simple XML-RPC server that allows functions and a single instance
575 attempts to dispatch XML-RPC calls to the functions or instance
582 # Warning: this is for debugging purposes only! Never set this to True in
595 # [Bug #1222790] If possible, set close-on-exec flag; if a
604 """Multipath XML-RPC Server
608 'virtual XML-RPC servers' at the same port.
642 """Simple handler for XML-RPC data passed through CGI."""
648 """Handle a single XML-RPC request"""
652 print 'Content-Type: text/xml'
653 print 'Content-Length: %d' % len(response)
661 XML-RPC uses the POST method.
675 print 'Content-Type: %s' % BaseHTTPServer.DEFAULT_ERROR_CONTENT_TYPE
676 print 'Content-Length: %d' % len(response)
681 """Handle a single XML-RPC request passed through a CGI post method.
684 XML-RPC response is printed to stdout along with the correct HTTP
696 length = -1
703 print 'Running XML-RPC server on port 8000'
706 server.register_function(lambda x,y: x+y, 'add')