Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble-scripts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hacker <dd0t@users.sourceforge.net>2010-10-05 20:11:29 +0400
committerStefan Hacker <dd0t@users.sourceforge.net>2010-10-05 20:11:29 +0400
commit2feb75f0bb346b3ae2dd3093a94a188ac6cd5b5c (patch)
tree517843d02f603fa9bf34744bef205ac1ae86c5ce /Helpers
parent966f6780459bdd53677648489dcf32c47da7c910 (diff)
Fix typo in modmurmur.py and add make it recognize invalid passwords on connect
Diffstat (limited to 'Helpers')
-rw-r--r--Helpers/modmurmur.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/Helpers/modmurmur.py b/Helpers/modmurmur.py
index bea9a57..6a59074 100644
--- a/Helpers/modmurmur.py
+++ b/Helpers/modmurmur.py
@@ -61,7 +61,7 @@ class MurmurServer(object):
def connect(self, host = "127.0.0.1", port = 6502, secret = None, prxstr = None):
if self.__ice:
- self.__log.warning("Connection attempt while already connected, disconnect first")
+ self.__log.warning("Connection attempt with tainted object, disconnect first")
return True
if not prxstr:
@@ -79,7 +79,7 @@ class MurmurServer(object):
self.__ice = ice
if secret:
- __ice.getImplicitContext().put("secret", secret)
+ ice.getImplicitContext().put("secret", secret)
prx = ice.stringToProxy(prxstr)
self.__prx = prx
@@ -175,7 +175,16 @@ class MurmurServer(object):
return False
# Get the meta object for the server
- self.__meta = self.Murmur.MetaPrx.uncheckedCast(self.__prx)
+ try:
+ self.__meta = self.Murmur.MetaPrx.checkedCast(self.__prx)
+ self.__meta.getServer(0) # Triggers an invalid secret exception if secret is invalid
+ except self.Murmur.InvalidSecretException:
+ self.__log.critical("Invalid secret")
+ return False
+ except Exception, e:
+ self.__log.critical("Could not cast meta object, connecting failed")
+ self.__log.exception(e)
+ return False
self.__log.debug("Map meta into self")
for name in dir(self.__meta):