Ticket #3083: xmpppy.diff
| File xmpppy.diff, 1.3 KB (added by asterix, 2 years ago) |
|---|
-
src/common/xmpp/dispatcher_nb.py
49 49 self.RegisterHandlerOnce, self.UnregisterHandler, self.RegisterProtocol, \ 50 50 self.SendAndWaitForResponse, self.send,self.disconnect, \ 51 51 self.SendAndCallForResponse, self.getAnID, self.Event] 52 self.previous_size = 0 52 53 53 54 def getAnID(self): 54 55 global ID … … 131 132 if len(self._pendingExceptions) > 0: 132 133 _pendingException = self._pendingExceptions.pop() 133 134 raise _pendingException[0], _pendingException[1], _pendingException[2] 135 # test incomming stanza before we parse it to avoid disconnections 136 size = len(data) 137 # 16384 is the maximum size of a SSL packet 138 # This mean this stanza or previous stanza is incomplete. Don't check it 139 if size != 16384 and self.previous_size != 16384: 140 if data.find('stream:') < 0: 141 try: 142 simplexml.NodeBuilder(data) 143 except ExpatError: 144 self.DEBUG(10*'=' + '<<MALFORMED XML>>' + 10*'=') 145 self.DEBUG(data) 146 self.DEBUG(10*'=' + '<< END MALFORMED XML>>' + 10*'=') 147 self.previous_size = size 148 return '0' 149 self.previous_size = size 134 150 try: 135 151 self.Stream.Parse(data) 136 152 # end stream:stream tag received
