Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     Connection.__init__(self, *args, **kwargs)
     self.max_header_line_size = int(1024 * self.opts.max_header_line_size)
     self.max_request_body_size = int(1024 * 1024 *
                                      self.opts.max_request_body_size)
     self.forwarded_for = None
     self.request_original_uri = None
Ejemplo n.º 2
0
 def close(self):
     if self.in_websocket_mode:
         try:
             self.websocket_handler.handle_websocket_close(self.websocket_connection_id)
         except Exception:
             self.log.exception('Error in WebSocket close handler')
         # Try to write a close frame, just once
         try:
             if self.send_buf is None and not self.ws_close_sent:
                 self.websocket_close(SHUTTING_DOWN, 'Shutting down')
                 with self.cf_lock:
                     self.write(self.control_frames.pop())
         except Exception:
             pass
         Connection.close(self)
     else:
         HTTPConnection.close(self)
Ejemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     Connection.__init__(self, *args, **kwargs)
     self.max_header_line_size = int(1024 * self.opts.max_header_line_size)
     self.max_request_body_size = int(1024 * 1024 * self.opts.max_request_body_size)
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     Connection.__init__(self, *args, **kwargs)
     self.max_header_line_size = int(1024 * self.opts.max_header_line_size)
     self.max_request_body_size = int(1024 * 1024 * self.opts.max_request_body_size)