Changeset 8716
- Timestamp:
- 09/04/07 22:08:13 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11.1/src/common/zeroconf/client_zeroconf.py
r8655 r8716 122 122 else: 123 123 self.sock_type = TYPE_CLIENT 124 self.fd = -1 124 125 conn = P2PConnection('', _sock, host, port, self._caller, self.on_connect, self) 125 126 self.sock_hash = conn._sock.__hash__ … … 130 131 stanza, is_message = val 131 132 if is_message: 132 if self.conn_holder.number_of_awaiting_messages.has_key(self.fd): 133 self.conn_holder.number_of_awaiting_messages[self.fd]+=1 133 if self.fd == -1: 134 self._caller.dispatch('MSGERROR',[unicode(self.to), -1, \ 135 _('Connection to host could not be established'), None, None]) 134 136 else: 135 self.conn_holder.number_of_awaiting_messages[self.fd]=1 137 if self.conn_holder.number_of_awaiting_messages.has_key(self.fd): 138 self.conn_holder.number_of_awaiting_messages[self.fd]+=1 139 else: 140 self.conn_holder.number_of_awaiting_messages[self.fd]=1 136 141 137 142 def add_stanza(self, stanza, is_message = False): … … 208 213 def on_disconnect(self): 209 214 if self.conn_holder: 210 if self.conn_holder.number_of_awaiting_messages.has_key(self. fd):211 if self.conn_holder.number_of_awaiting_messages[self. fd] > 0:215 if self.conn_holder.number_of_awaiting_messages.has_key(self.conn_holder.fd): 216 if self.conn_holder.number_of_awaiting_messages[self.conn_holder.fd] > 0: 212 217 self._caller.dispatch('MSGERROR',[unicode(self.to), -1, \ 213 218 _('Connection to host could not be established'), None, None]) 214 del self.conn_holder.number_of_awaiting_messages[self. fd]219 del self.conn_holder.number_of_awaiting_messages[self.conn_holder.fd] 215 220 self.conn_holder.remove_connection(self.sock_hash) 216 221 if self.__dict__.has_key('Dispatcher'):
