rpki.https.http_server Class Reference

Inherits rpki::https::http_stream.

Collaboration diagram for rpki.https.http_server:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def find_handler
def handle_message
def handle_no_content_length
def send_error
def send_message
def send_reply
def tls_accept

Public Attributes

 expect_close
 handlers
 retry_read
 retry_write
 tls

Static Public Attributes

 parse_type = http_request
 Stream parser should look for incoming HTTP request messages.
 timeout = default_server_timeout
 Use the default server timeout value set in the module header.

Detailed Description

HTTP(S) server stream.

Definition at line 561 of file https.py.


Member Function Documentation

def rpki.https.http_server.__init__ (   self,
  sock,
  handlers,
  cert = None,
  key = None,
  ta = (),
  dynamic_ta = None 
)

Definition at line 574 of file https.py.

def rpki.https.http_server.find_handler (   self,
  path 
)
Helper method to search self.handlers.

Definition at line 635 of file https.py.

def rpki.https.http_server.handle_message (   self  ) 
TLS and HTTP layers managed to deliver a complete HTTP request to
us, figure out what to do with it.  Check the command and
Content-Type, look for a handler, and if everything looks right,
pass the message body, path, and a reply callback to the handler.

Definition at line 644 of file https.py.

def rpki.https.http_server.handle_no_content_length (   self  ) 
Handle an incoming message that used neither chunking nor a
Content-Length header (that is: this message will be the last one
in this server stream).  No special action required.

Definition at line 627 of file https.py.

def rpki.https.http_server.send_error (   self,
  code,
  reason 
)
Send an error response to this request.

Definition at line 673 of file https.py.

def rpki.https.http_server.send_message (   self,
  code,
  reason = "OK",
  body = None 
)
Queue up reply message.  If both parties agree that connection is
persistant, and if no error occurred, restart this stream to
listen for next message; otherwise, queue up a close event for
this stream so it will shut down once the reply has been sent.

Definition at line 685 of file https.py.

def rpki.https.http_server.send_reply (   self,
  code,
  body 
)
Send a reply to this request.

Definition at line 679 of file https.py.

def rpki.https.http_server.tls_accept (   self  ) 
Set up TLS for server side connection, handling all the whacky
OpenSSL exceptions from TLS.

SSLErrorSSLError exceptions are particularly nasty, because all
too often they indicate a certificate lookup failure deep within
the guts of OpenSSL's TLS connection setup logic.  Extracting
anything resembling a Python data structure from a handler called
that deep inside the OpenSSL TLS library, while theoretically
possible, runs a high risk of triggering some kind of memory leak
or corruption.  So, for now, we just get back a long text string,
which we break up and log but don't attempt to process further.

Definition at line 596 of file https.py.


Member Data Documentation

Definition at line 578 of file https.py.

Definition at line 576 of file https.py.

Stream parser should look for incoming HTTP request messages.

Definition at line 568 of file https.py.

Reimplemented from rpki.https.http_stream.

Definition at line 613 of file https.py.

Reimplemented from rpki.https.http_stream.

Definition at line 615 of file https.py.

Use the default server timeout value set in the module header.

Definition at line 572 of file https.py.

Reimplemented from rpki.https.http_stream.

Definition at line 582 of file https.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables
Generated on Wed May 12 19:43:49 2010 for RPKI Engine by  doxygen 1.6.3