comparison irclib.py @ 128:e1e66c563d08

minor fixes in irclib Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Thu, 14 Jan 2010 11:08:13 +0100
parents efdc038e757a
children 46af7f2744a9
comparison
equal deleted inserted replaced
127:db3f648a9e9e 128:e1e66c563d08
530 530
531 This method closes the connection permanently; after it has 531 This method closes the connection permanently; after it has
532 been called, the object is unusable. 532 been called, the object is unusable.
533 """ 533 """
534 534
535 self.disconnect(message, volontary)
536 self.irclibobj._remove_connection(self) 535 self.irclibobj._remove_connection(self)
536 self.disconnect(message=message, volontary=volontary)
537 537
538 def _get_socket(self): 538 def _get_socket(self):
539 """[Internal]""" 539 """[Internal]"""
540 return self.socket 540 return self.socket
541 541
564 """[Internal]""" 564 """[Internal]"""
565 565
566 try: 566 try:
567 if self.ssl: 567 if self.ssl:
568 new_data = self.ssl.read(2**14) 568 new_data = self.ssl.read(2**14)
569 elif self.socket:
570 new_data = self.socket.recv(2**14)
569 else: 571 else:
570 new_data = self.socket.recv(2**14) 572 return
571 except socket.error, x: 573 except socket.error, x:
572 # The server hung up. 574 # The server hung up.
573 self.disconnect("Connection reset by peer") 575 self.disconnect("Connection reset by peer")
574 return 576 return
575 if not new_data: 577 if not new_data: