source:
ralphm-patches/router_unknown.patch
@
57:0d8b6cf41728
Last change on this file since 57:0d8b6cf41728 was 57:0d8b6cf41728, checked in by Ralph Meijer <ralphm@…>, 9 years ago | |
---|---|
File size: 1.5 KB |
-
wokkel/component.py
# HG changeset patch # Parent 3d3065a425fa27c45c1f25aae8910f282f3049a4 Send back an error if there is no known route to the stanza's destination. This is most useful in situations where there is no server-to-server component that acts as the default route (indexed by `None`). diff -r 3d3065a425fa wokkel/component.py
a b 332 332 """ 333 333 destination = JID(stanza['to']) 334 334 335 log.msg("Routing to %s: %r" % (destination.full(), stanza.toXml()))336 335 337 336 if destination.host in self.routes: 337 log.msg("Routing to %s: %r" % (destination.full(), 338 stanza.toXml())) 338 339 self.routes[destination.host].send(stanza) 340 elif None in self.routes: 341 log.msg("Routing to %s (default route): %r" % (destination.full(), 342 stanza.toXml())) 343 self.routes[None].send(stanza) 339 344 else: 340 self.routes[None].send(stanza) 345 log.msg("No route to %s: %r" % (destination.full(), 346 stanza.toXml())) 347 if stanza.getAttribute('type') not in ('result', 'error'): 348 # No route, send back error 349 exc = error.StanzaError('remote-server-timeout', type='wait') 350 exc.code = '504' 351 response = exc.toResponse(stanza) 352 self.route(response) 341 353 342 354 343 355
Note: See TracBrowser
for help on using the repository browser.