示例#1
0
    def handle_error(self, e=None):
        import traceback
        traceback.print_exc()
        t, v = sys.exc_info()[:2]
        if t is not None:
            msg = get(get(v.args, 0, 'say what?'), 'message', '')
            if msg.startswith('bad write retry'):
                assert False
                self.__logger.error(
                    'Got that weird-ass "bad write retry" message in jabber socket'
                )
#                return

        sslzero_closes = pref('jabber.ssl_error_zero.should_close',
                              type=bool,
                              default=True)
        if t is SSLError and get(v.args, 0, sentinel) == 0:
            self.__logger('SSL error 0!')
            if not sslzero_closes:
                self.__logger('\tnot closing')
                return

        self.__logger.debug('handle_error in %r', self)
        async_chat.close(self)
        if not self.killed:
            self.killed = True
            self.on_error()
示例#2
0
 def handle_close(self):
     async_chat.close(self)
     print "Connection is interrupted"
     tmp = self.room
     tmp.remove(self)
     if self.name != None:
         tmp.broadcast("sys_message " + self.name + " leaves the chat.", 1)
示例#3
0
文件: _http.py 项目: mcruse/monotone
 def close(self):
     self._is_connected = False
     if self._current_request:
         try:
             self._current_request.handle_close()
         except:
             msglog.exception(prefix = 'Handled')
     AsyncChat.close(self)
     self.log_info('closed.', msglog.types.DB)
示例#4
0
 def close(self):
     self._is_connected = False
     if self._current_request:
         try:
             self._current_request.handle_close()
         except:
             msglog.exception(prefix='Handled')
     AsyncChat.close(self)
     self.log_info('closed.', msglog.types.DB)
示例#5
0
    def handle_error(self, e=None):
        import traceback;traceback.print_exc()
        t, v = sys.exc_info()[:2]
        if t is not None:
            msg = get(get(v.args, 0, 'say what?'), 'message', '')
            if msg.startswith('bad write retry'):
                assert False
                self.__logger.error('Got that weird-ass "bad write retry" message in jabber socket')
#                return

        sslzero_closes = pref('jabber.ssl_error_zero.should_close', type = bool, default = True)
        if t is SSLError and get(v.args, 0, sentinel) == 0:
            self.__logger('SSL error 0!')
            if not sslzero_closes:
                self.__logger('\tnot closing')
                return

        self.__logger.debug('handle_error in %r', self)
        async_chat.close(self)
        if not self.killed:
            self.killed = True
            self.on_error()
示例#6
0
 def handle_close(self):
     self.__logger.debug('handle_close in %r', self)
     async_chat.close(self)
     if not self.killed:
         self.killed = True
         self.on_close()
示例#7
0
 def handle_close(self):
     self.__logger.debug('handle_close in %r', self)
     async_chat.close(self)
     if not self.killed:
         self.killed = True
         self.on_close()