ignore unknown rendezvous messages

I should have added this earlier, so 0.7.5 would be tolerant of new
server messages.
This commit is contained in:
Brian Warner 2016-05-06 18:29:19 -07:00
parent 3f5b66eddc
commit cd9f6e4377

View File

@ -5,6 +5,7 @@ from binascii import hexlify, unhexlify
from twisted.internet import reactor, defer, endpoints, error from twisted.internet import reactor, defer, endpoints, error
from twisted.internet.threads import deferToThread, blockingCallFromThread from twisted.internet.threads import deferToThread, blockingCallFromThread
from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.python import log
from autobahn.twisted import websocket from autobahn.twisted import websocket
from nacl.secret import SecretBox from nacl.secret import SecretBox
from nacl.exceptions import CryptoError from nacl.exceptions import CryptoError
@ -133,7 +134,9 @@ class Wormhole:
mtype = msg["type"] mtype = msg["type"]
meth = getattr(self, "_ws_handle_"+mtype, None) meth = getattr(self, "_ws_handle_"+mtype, None)
if not meth: 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) return meth(msg)
def _ws_handle_welcome(self, msg): def _ws_handle_welcome(self, msg):