Gentoo Archives: gentoo-commits

From: "Maurice van der Pot (griffon26)" <griffon26@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-im/pymsn-t/files: pymsn-t-0.11.3-remove-pid.patch pymsn-t-0.11.3-delete-reactor.patch pymsn-t-0.11.3-unexpected-xfr.patch
Date: Tue, 23 Sep 2008 20:17:42
Message-Id: E1KiEKJ-0001cJ-S7@stork.gentoo.org
1 griffon26 08/09/23 20:17:39
2
3 Added: pymsn-t-0.11.3-remove-pid.patch
4 pymsn-t-0.11.3-delete-reactor.patch
5 pymsn-t-0.11.3-unexpected-xfr.patch
6 Log:
7 Add some patches to pymsn-t for bug #238085
8 (Portage version: 2.2_rc8/cvs/Linux 2.6.26.2 x86_64)
9
10 Revision Changes Path
11 1.1 net-im/pymsn-t/files/pymsn-t-0.11.3-remove-pid.patch
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/pymsn-t/files/pymsn-t-0.11.3-remove-pid.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/pymsn-t/files/pymsn-t-0.11.3-remove-pid.patch?rev=1.1&content-type=text/plain
15
16 Index: pymsn-t-0.11.3-remove-pid.patch
17 ===================================================================
18 --- pymsn-t/src/main.py 2008-04-04 17:45:43.000000000 +0400
19 +++ pymsn-t/src/main.py 2008-08-05 17:44:17.000000000 +0400
20 @@ -91,6 +91,7 @@
21 from twisted.words.xish.domish import Element
22 from twisted.words.protocols.jabber import component
23 from twisted.words.protocols.jabber.jid import internJID
24 +from twisted.python import log
25
26 from debug import LogEvent, INFO, WARN, ERROR
27
28 @@ -352,13 +353,29 @@
29 pf = open(config.pid, "w")
30 pf.write("%s\n" % pid)
31 pf.close()
32 +
33 + def removePID(self, pidfile):
34 + # Remove a PID file
35 + if not pidfile:
36 + return
37 + try:
38 + os.unlink(pidfile)
39 + except OSError, e:
40 + if e.errno == errno.EACCES or e.errno == errno.EPERM:
41 + log.msg("Warning: No permission to delete pid file")
42 + else:
43 + log.msg("Failed to unlink PID file:")
44 + log.deferr()
45 + except:
46 + log.msg("Failed to unlink PID file:")
47 + log.deferr()
48
49 def shuttingDown(self):
50 self.transportSvc.removeMe()
51 # Keep the transport running for another 3 seconds
52 def cb(ignored=None):
53 if config.pid:
54 - twistd.removePID(config.pid)
55 + self.removePID(config.pid)
56 d = Deferred()
57 d.addCallback(cb)
58 reactor.callLater(3.0, d.callback, None)
59
60
61
62 1.1 net-im/pymsn-t/files/pymsn-t-0.11.3-delete-reactor.patch
63
64 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/pymsn-t/files/pymsn-t-0.11.3-delete-reactor.patch?rev=1.1&view=markup
65 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/pymsn-t/files/pymsn-t-0.11.3-delete-reactor.patch?rev=1.1&content-type=text/plain
66
67 Index: pymsn-t-0.11.3-delete-reactor.patch
68 ===================================================================
69 --- pymsn-t/src/main.py 2008-09-19 10:53:30.000000000 +0200
70 +++ pymsn-t/src/main.py 2008-09-19 10:55:55.000000000 +0200
71 @@ -72,7 +72,6 @@
72
73 if config.reactor:
74 # They picked their own reactor. Lets install it.
75 - del sys.modules["twisted.internet.reactor"]
76 if config.reactor == "epoll":
77 from twisted.internet import epollreactor
78 epollreactor.install()
79
80
81
82 1.1 net-im/pymsn-t/files/pymsn-t-0.11.3-unexpected-xfr.patch
83
84 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/pymsn-t/files/pymsn-t-0.11.3-unexpected-xfr.patch?rev=1.1&view=markup
85 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/pymsn-t/files/pymsn-t-0.11.3-unexpected-xfr.patch?rev=1.1&content-type=text/plain
86
87 Index: pymsn-t-0.11.3-unexpected-xfr.patch
88 ===================================================================
89 --- pymsn-t/src/legacy/glue.py 2008-09-19 10:53:30.000000000 +0200
90 +++ pymsn-t/src/legacy/glue.py 2008-09-19 10:52:38.000000000 +0200
91 @@ -379,7 +379,13 @@
92 self.session.removeMe()
93
94 def connectionLost(self, reason):
95 - LogEvent(INFO, self.jabberID)
96 + LogEvent(INFO, self.jabberID)
97 + # If we got a second referral, don't really log out but let the next NS
98 + # try to log us in
99 + if reason.type == error.ConnectionDone and self.gotadditionalXFR != 0:
100 + LogEvent(INFO, self.ident)
101 + self.gotadditionalXFR = 0
102 + return
103 if reason.type != error.ConnectionDone:
104 text = lang.get(self.session.lang).msnDisconnected % reason
105 self.session.sendMessage(to=self.jabberID, fro=config.jid, body=text)
106 --- pymsn-t/src/legacy/msn/msn.py 2008-09-19 10:53:30.000000000 +0200
107 +++ pymsn-t/src/legacy/msn/msn.py 2008-09-19 10:52:38.000000000 +0200
108 @@ -1347,7 +1347,9 @@
109 port = MSN_PORT
110
111 if not self._fireCallback(id, host, int(port), params[4]):
112 - raise MSNProtocolError, "Got XFR (referral) that I didn't ask for .. should this happen?" # debug
113 + #raise MSNProtocolError, "Got XFR (referral) that I didn't ask for .. should this happen?" # debug
114 + self.factory.msncon.gotadditionalXFR = 1
115 + self.factory.msncon.connectors.append(reactor.connectTCP(host, int(port), self.factory, bindAddress=(self.factory.msncon.BINDADDRESS, 0)))
116
117 def handle_RNG(self, params):
118 checkParamLen(len(params), 6, 'RNG')
119 --- pymsn-t/src/legacy/msn/msnw.py 2008-09-19 10:53:30.000000000 +0200
120 +++ pymsn-t/src/legacy/msn/msnw.py 2008-09-19 10:52:38.000000000 +0200
121 @@ -67,8 +67,9 @@
122 LogEvent(INFO, self.ident)
123
124 def _gotNotificationReferral(self, (host, port)):
125 - self.timeout.cancel()
126 - self.timeout = None
127 + if self.timeout != None:
128 + self.timeout.cancel()
129 + self.timeout = None
130 # Create the NotificationClient
131 self.notificationFactory = msn.NotificationFactory()
132 self.notificationFactory.userHandle = self.username