Esempio n. 1
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error, v:
         # Ignoring connection reset by peer exceptions
         if v[0] != errno.ECONNRESET:
             raise
Esempio n. 2
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except Exception as e:
         logger.debug('Exception in handle_one_request')
         if '10053' in e.args:
             logger.debug('Browser closed connection before response completed.')
Esempio n. 3
0
 def handle_one_request(self):
     u"""1つのリクエストを処理する."""
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error, e:
         logging.debug("%s stopped handling the request."\
                       " Reason: %s" % (self, str(e)))
Esempio n. 4
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except:
         self.close_connection = 1
         self.rfile = None
         self.wfile = None
Esempio n. 5
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error, v:
         # Ignoring connection reset by peer exceptions
         if v[0] != errno.ECONNRESET:
             raise
Esempio n. 6
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except:
         self.response = str(FrameworkException(sys.exc_info()))
         self.sendHead(includeCookie=False)
         self.wfile.write(self.response)
         raise
Esempio n. 7
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error, e:
         if e.errno == errno.ECONNRESET:
             pass  # ignore the error
         else:
             raise
Esempio n. 8
0
	def handle_one_request(self):
		try:
			BaseHTTPRequestHandler.handle_one_request(self)
		except:
			self.response = str(FrameworkException(sys.exc_info()))
			self.sendHead(includeCookie = False)
			self.wfile.write(self.response)
			raise
Esempio n. 9
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error, e:
         if e.errno == errno.ECONNRESET:
             pass   # ignore the error
         else:
             raise
Esempio n. 10
0
    def handle_one_request(self):
        """
        Handle a request.
        Override the superclass implementation to silence disconnect errors.
        """
        try:
            BaseHTTPRequestHandler.handle_one_request(self)

        except socket.error:
            LOGGER.debug('client disconnected: {}'.format(self.path))
Esempio n. 11
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error, e:
         if e.errno == errno.ECONNRESET:
             self.close_connection = 1
             pass   # ignore the error
         elif e.errno == errno.EPIPE:
             self.close_connection = 1
             self.wfile._wbuf = None
             self.wfile.close()
             self.log_error('"%s" Broken pipe', self.raw_requestline.strip() if self.raw_requestline else '')
         else:
             raise
Esempio n. 12
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error, v:
         if v[0] == errno.ECONNRESET:
             # Ignoring connection reset by peer exceptions
             print 'Detected connection reset'
         elif v[0] == errno.EPIPE:
             print 'Detected remote peer disconnected'
         elif v[0] == 10053:
             print 'An established connection was aborted by the' \
                 ' software in your host machine'
         else:
             raise
Esempio n. 13
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error, v:
         if v[0] == errno.ECONNRESET:
             # Ignoring connection reset by peer exceptions
             print 'Detected connection reset'
         elif v[0] == errno.EPIPE:
             print 'Detected remote peer disconnected'
         elif v[0] == 10053:
             print 'An established connection was aborted by the' \
                 ' software in your host machine'
         else:
             raise
Esempio n. 14
0
 def handle_one_request(self):
     self.stud_addr = ""
     if header:
         af_type = self.rfile.read(1)
         if ord(af_type[0]) == socket.AF_INET:
             addr_packed = self.rfile.read(4)
             addr = socket.inet_ntoa(addr_packed)
             self.stud_addr = addr
     return BaseHTTPRequestHandler.handle_one_request(self)
Esempio n. 15
0
 def handle_one_request(self):
     self.stud_addr = ""
     if header:
         af_type = self.rfile.read(1)
         if ord(af_type[0]) == socket.AF_INET:
             addr_packed = self.rfile.read(4)
             addr = socket.inet_ntoa(addr_packed)
             self.stud_addr=addr
     return BaseHTTPRequestHandler.handle_one_request(self)
Esempio n. 16
0
    def handle_one_request(self):
        # Wait before going to "readline" to ensure we may escape on
        # server shutdown or socket exception
        lsock = [self.request]
        isock, osock, esock = select.select(lsock, [], lsock, self.config.keepaliveInTimeout)
        if esock or self.config.doExit:
            self.logHpp('Exiting on: esock %d or doExit ' % (len(esock), self.config.doExit))
            self.close_connection = 1
            self.closeConnOut()
            return

        if not isock and not osock and not esock:
            self.logHpp('Exiting on timeout')
            # timeout - we close the connection
            self.close_connection = 1
            # store any existing outgoing
            self.closeConnOut()
            return

        BaseHTTPRequestHandler.handle_one_request(self)
Esempio n. 17
0
    def handle_one_request(self):
        # Wait before going to "readline" to ensure we may escape on
        # server shutdown or socket exception
        lsock = [self.request]
        isock, osock, esock = select.select(lsock, [], lsock,
                                            self.config.keepaliveInTimeout)
        if esock or self.config.doExit:
            self.logHpp('Exiting on: esock %d or doExit ' %
                        (len(esock), self.config.doExit))
            self.close_connection = 1
            self.closeConnOut()
            return

        if not isock and not osock and not esock:
            self.logHpp('Exiting on timeout')
            # timeout - we close the connection
            self.close_connection = 1
            # store any existing outgoing
            self.closeConnOut()
            return

        BaseHTTPRequestHandler.handle_one_request(self)
Esempio n. 18
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except:
         print "handle_one_request error"
Esempio n. 19
0
 def handle_one_request(self):
     print("handing request")
     BaseHTTPRequestHandler.handle_one_request(self)
Esempio n. 20
0
 def handle_one_request(self):
     try:
         BaseHTTPRequestHandler.handle_one_request(self)
     except socket.error as ex:
         self.__handle_close_error(ex)