projects
/
theonering
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4787b1f
)
Combinging disconnect code to try and minimize errors with the logic
author
Ed Page
<eopage@byu.net>
Tue, 9 Feb 2010 04:08:15 +0000
(22:08 -0600)
committer
Ed Page
<eopage@byu.net>
Tue, 9 Feb 2010 04:08:15 +0000
(22:08 -0600)
src/autogv.py
patch
|
blob
|
history
src/connection.py
patch
|
blob
|
history
diff --git
a/src/autogv.py
b/src/autogv.py
index
7999ed4
..
0a960c8
100644
(file)
--- a/
src/autogv.py
+++ b/
src/autogv.py
@@
-173,12
+173,8
@@
class AutoDisconnect(object):
if not self.session.is_logged_in():
_moduleLogger.info("Received connection change event when not logged in")
return
if not self.session.is_logged_in():
_moduleLogger.info("Received connection change event when not logged in")
return
- self._connRef().StatusChanged(
- telepathy.CONNECTION_STATUS_DISCONNECTED,
- telepathy.CONNECTION_STATUS_REASON_NETWORK_ERROR
- )
try:
try:
- self._connRef().disconnect()
+ self._connRef().disconnect(telepathy.CONNECTION_STATUS_REASON_NETWORK_ERROR)
except Exception:
_moduleLogger.exception("Error durring disconnect")
self.__delayedDisconnectEventId = None
except Exception:
_moduleLogger.exception("Error durring disconnect")
self.__delayedDisconnectEventId = None
diff --git
a/src/connection.py
b/src/connection.py
index
cbdb388
..
22d6885
100644
(file)
--- a/
src/connection.py
+++ b/
src/connection.py
@@
-231,12
+231,8
@@
class TheOneRingConnection(
"""
For org.freedesktop.telepathy.Connection
"""
"""
For org.freedesktop.telepathy.Connection
"""
- self.StatusChanged(
- telepathy.CONNECTION_STATUS_DISCONNECTED,
- telepathy.CONNECTION_STATUS_REASON_REQUESTED
- )
try:
try:
- self.disconnect()
+ self.disconnect(telepathy.CONNECTION_STATUS_REASON_REQUESTED)
except Exception:
_moduleLogger.exception("Error durring disconnect")
except Exception:
_moduleLogger.exception("Error durring disconnect")
@@
-277,8
+273,15
@@
class TheOneRingConnection(
return props
return props
- def disconnect(self):
+ def disconnect(self, reason):
_moduleLogger.info("Disconnecting")
_moduleLogger.info("Disconnecting")
+ # Not having the disconnect first can cause weird behavior with clients
+ # including not being able to reconnect or even crashing
+ self.StatusChanged(
+ telepathy.CONNECTION_STATUS_DISCONNECTED,
+ reason,
+ )
+
for plumber in self._plumbing:
plumber.stop()
for plumber in self._plumbing:
plumber.stop()