Source

ediarpc / ediarpc / rpc_server.py

Diff from to

File ediarpc/rpc_server.py

             self.wfile.write(response)
 
 class RPCServer(SocketServer.TCPServer, RPCRequestHandler):
-    def __init__(self, tuple, secret):
+    def __init__(self, tuple, secret, iterations=1000):
         SocketServer.TCPServer.__init__(self, tuple, RPCRequestHandler)
         self.funcs = {}
         self.secret = secret
+        self.iterations = iterations
 
     def _reply(self, method, **kwargs):
-        return rpc_message.encode(self.secret, method, **kwargs)
+        return rpc_message.encode(self.secret, method, iterations=self.iterations, **kwargs)
 
     def _error_message(self, code, message):
         return self._reply('error_response', error_code=code, error_message=message)
 
     def dispatch(self, envelope):
         try:
-            unpack_message = rpc_message.decode(self.secret, envelope)
+            unpack_message = rpc_message.decode(self.secret, envelope, iterations=self.iterations)
         except InvalidSignatureException:
             return self._error_message(403, "Unauthorized, invalid passphrase")