mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
It works!
- Fixed error reporting. - Fixed variable key error. - Added a couple debugging statements.
This commit is contained in:
parent
96b8171871
commit
f6b4f0cc07
@ -258,23 +258,27 @@ class Santiago(object):
|
|||||||
logging.debug("santiago.Santiago.incoming_request: unpacked {0}".format(str(unpacked)))
|
logging.debug("santiago.Santiago.incoming_request: unpacked {0}".format(str(unpacked)))
|
||||||
|
|
||||||
if unpacked["locations"]:
|
if unpacked["locations"]:
|
||||||
|
logging.debug("santiago.Santiago.incoming_request: handling reply")
|
||||||
|
|
||||||
self.handle_reply(
|
self.handle_reply(
|
||||||
unpacked["from"], unpacked["to"],
|
unpacked["from"], unpacked["to"],
|
||||||
unpacked["host"], unpacked["client"],
|
unpacked["host"], unpacked["client"],
|
||||||
unpacked["service"], unpacked["locations"],
|
unpacked["service"], unpacked["locations"],
|
||||||
unpacked["reply_to"],
|
unpacked["reply_to"],
|
||||||
unpacked["request_version"],
|
unpacked["request_version"],
|
||||||
unpacked["reply_version"])
|
unpacked["reply_versions"])
|
||||||
else:
|
else:
|
||||||
|
logging.debug("santiago.Santiago.incoming_request: handling request")
|
||||||
|
|
||||||
self.handle_request(
|
self.handle_request(
|
||||||
unpacked["from"], unpacked["to"],
|
unpacked["from"], unpacked["to"],
|
||||||
unpacked["host"], unpacked["client"],
|
unpacked["host"], unpacked["client"],
|
||||||
unpacked["service"], unpacked["reply_to"],
|
unpacked["service"], unpacked["reply_to"],
|
||||||
unpacked["request_version"],
|
unpacked["request_version"],
|
||||||
unpacked["reply_version"])
|
unpacked["reply_versions"])
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception("Error: ", str(e))
|
logging.exception(e)
|
||||||
|
|
||||||
def unpack_request(self, request):
|
def unpack_request(self, request):
|
||||||
"""Decrypt and verify the request.
|
"""Decrypt and verify the request.
|
||||||
@ -404,7 +408,8 @@ class Santiago(object):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def handle_reply(self, from_, to, host, client,
|
def handle_reply(self, from_, to, host, client,
|
||||||
service, locations, reply_to):
|
service, locations, reply_to,
|
||||||
|
request_version, reply_versions):
|
||||||
"""Process a reply from a Santiago service.
|
"""Process a reply from a Santiago service.
|
||||||
|
|
||||||
The last call in the chain that makes up the Santiago system, we now
|
The last call in the chain that makes up the Santiago system, we now
|
||||||
@ -442,6 +447,15 @@ class Santiago(object):
|
|||||||
self.learn_service(host, service, locations)
|
self.learn_service(host, service, locations)
|
||||||
|
|
||||||
self.requests[host].remove(service)
|
self.requests[host].remove(service)
|
||||||
|
# clean buffers
|
||||||
|
if not self.requests[host]:
|
||||||
|
del self.requests[host]
|
||||||
|
|
||||||
|
logging.debug("santiago.Santiago.handle_reply: Success!")
|
||||||
|
logging.debug("santiago.Santiago.handle_reply: consuming {0}".format(
|
||||||
|
self.consuming))
|
||||||
|
logging.debug("santiago.Santiago.handle_reply: requests {0}".format(
|
||||||
|
self.requests))
|
||||||
|
|
||||||
def save_server(self):
|
def save_server(self):
|
||||||
"""Save all operational data to files.
|
"""Save all operational data to files.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user