Package ganeti :: Package http :: Module server :: Class HttpServer
[hide private]
[frames] | no frames]

Class HttpServer

source code


Generic HTTP server class

Users of this class must subclass it and override the HandleRequest function.

Instance Methods [hide private]
 
__init__(self, mainloop, local_address, port, ssl_params=None, ssl_verify_peer=False, request_executor_class=None)
Initializes the HTTP server
source code
 
Start(self) source code
 
Stop(self) source code
 
handle_accept(self) source code
 
OnSignal(self, signum) source code
 
_CollectChildren(self, quick)
Checks whether any child processes are done
source code
 
_IncomingConnection(self)
Called for each incoming connection
source code
 
PreHandleRequest(self, req)
Called before handling a request.
source code
 
HandleRequest(self, req)
Handles a request.
source code

Inherited from HttpBase: GetSslCiphers

Inherited from HttpBase (private): _CreateSocket, _SSLVerifyCallback

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from asyncore.dispatcher: __getattr__, accept, add_channel, bind, close, connect, create_socket, del_channel, handle_close, handle_connect, handle_connect_event, handle_error, handle_expt, handle_expt_event, handle_read, handle_read_event, handle_write, handle_write_event, listen, log, log_info, readable, recv, send, set_reuse_addr, set_socket, writable

Class Variables [hide private]
  MAX_CHILDREN = 20

Inherited from asyncore.dispatcher: accepting, addr, closing, connected, debug, ignore_log_types

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, mainloop, local_address, port, ssl_params=None, ssl_verify_peer=False, request_executor_class=None)
(Constructor)

source code 

Initializes the HTTP server

Parameters:
  • mainloop (ganeti.daemon.Mainloop) - Mainloop used to poll for I/O events
  • local_address (string) - Local IP address to bind to
  • port (int) - TCP port to listen on
  • ssl_params (HttpSslParams) - SSL key and certificate
  • ssl_verify_peer (bool) - Whether to require client certificate and compare it with our certificate
  • request_executor_class (class) - an class derived from the HttpServerRequestExecutor class
Overrides: asyncore.dispatcher.__init__

handle_accept(self)

source code 
Overrides: asyncore.dispatcher.handle_accept

_CollectChildren(self, quick)

source code 

Checks whether any child processes are done

Parameters:
  • quick (bool) - Whether to only use non-blocking functions

PreHandleRequest(self, req)

source code 

Called before handling a request.

Can be overridden by a subclass.

HandleRequest(self, req)

source code 

Handles a request.

Must be overridden by subclass.