From cd9f6e437714baef1c46e2910457d582c2f1ab2f Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 6 May 2016 18:29:19 -0700 Subject: [PATCH] ignore unknown rendezvous messages I should have added this earlier, so 0.7.5 would be tolerant of new server messages. --- src/wormhole/twisted/transcribe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wormhole/twisted/transcribe.py b/src/wormhole/twisted/transcribe.py index 4edeffa..b2d34fb 100644 --- a/src/wormhole/twisted/transcribe.py +++ b/src/wormhole/twisted/transcribe.py @@ -5,6 +5,7 @@ from binascii import hexlify, unhexlify from twisted.internet import reactor, defer, endpoints, error from twisted.internet.threads import deferToThread, blockingCallFromThread from twisted.internet.defer import inlineCallbacks, returnValue +from twisted.python import log from autobahn.twisted import websocket from nacl.secret import SecretBox from nacl.exceptions import CryptoError @@ -133,7 +134,9 @@ class Wormhole: mtype = msg["type"] meth = getattr(self, "_ws_handle_"+mtype, None) if not meth: - raise ValueError("Unknown inbound message type %r" % (msg,)) + # make tests fail, but real application will ignore it + log.err(ValueError("Unknown inbound message type %r" % (msg,))) + return return meth(msg) def _ws_handle_welcome(self, msg):