RPKI Engine 1.0
Public Member Functions | Public Attributes | Static Public Attributes

rpki.http.http_stream Class Reference

Inheritance diagram for rpki.http.http_stream:
Inheritance graph
Collaboration diagram for rpki.http.http_stream:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def __repr__
def chunk_body
def chunk_discard_crlf
def chunk_discard_trailer
def chunk_header
def collect_incoming_data
def found_terminator
def get_buffer
def handle_body
def handle_close
def handle_error
def handle_timeout
def restart
def update_timeout

Public Attributes

 buffer
 chunk_handler
 msg
 timer

Static Public Attributes

 log = log_method
 show_tracebacks = False

Detailed Description

Virtual class representing an HTTP message stream.

Definition at line 298 of file http.py.


Constructor & Destructor Documentation

def rpki.http.http_stream.__init__ (   self,
  sock = None 
)

Definition at line 314 of file http.py.


Member Function Documentation

def rpki.http.http_stream.__repr__ (   self)

Definition at line 306 of file http.py.

def rpki.http.http_stream.chunk_body (   self)
Asynchat just handed us what should be the body of a chunk of the
body of a chunked message (sic).  Save it, and prepare to move on
to the next chunk.

Definition at line 406 of file http.py.

def rpki.http.http_stream.chunk_discard_crlf (   self)
Consume the CRLF that terminates a chunk, reinitialize chunk
decoder to be ready for the next chunk.

Definition at line 418 of file http.py.

def rpki.http.http_stream.chunk_discard_trailer (   self)
Consume chunk trailer, which should be empty, then (finally!) exit
the chunk decoder and hand complete message off to the application.

Definition at line 428 of file http.py.

def rpki.http.http_stream.chunk_header (   self)
Asynchat just handed us what should be the header of one chunk of
a chunked encoding stream.  If this chunk has a body, set the
stream up to read it; otherwise, this is the last chunk, so start
the process of exiting the chunk decoder.

Definition at line 390 of file http.py.

def rpki.http.http_stream.collect_incoming_data (   self,
  data 
)
Buffer incoming data from asynchat.

Definition at line 342 of file http.py.

def rpki.http.http_stream.found_terminator (   self)
Asynchat reported that it found whatever terminator we set, so
figure out what to do next.  This can be messy, because we can be
in any of several different states:

@li We might be handling chunked HTTP, in which case we have to
initialize the chunk decoder;

@li We might have found the end of the message body, in which case
we can (finally) process it; or

@li We might have just gotten to the end of the message headers,
in which case we have to parse them to figure out which of three
separate mechanisms (chunked, content-length, TCP close) is going
to tell us how to find the end of the message body.

Definition at line 357 of file http.py.

def rpki.http.http_stream.get_buffer (   self)
Consume data buffered from asynchat.

Definition at line 349 of file http.py.

def rpki.http.http_stream.handle_body (   self)
Hand normal (not chunked) message off to the application.

Definition at line 439 of file http.py.

def rpki.http.http_stream.handle_close (   self)
Wrapper around asynchat connection close handler, so that we can
log the event, cancel timer, and so forth.

Reimplemented in rpki.http.http_client.

Definition at line 470 of file http.py.

def rpki.http.http_stream.handle_error (   self)
Asynchat (or asyncore, or somebody) raised an exception.  See
whether it's one we should just pass along, otherwise log a stack
trace and close the stream.

Reimplemented in rpki.http.http_client.

Definition at line 446 of file http.py.

def rpki.http.http_stream.handle_timeout (   self)
Inactivity timer expired, close connection with prejudice.

Reimplemented in rpki.http.http_client.

Definition at line 463 of file http.py.

def rpki.http.http_stream.restart (   self)
(Re)start HTTP message parser, reset timer.

Definition at line 320 of file http.py.

def rpki.http.http_stream.update_timeout (   self)
Put this stream's timer in known good state: set it to the
stream's timeout value if we're doing timeouts, otherwise clear
it.

Definition at line 329 of file http.py.


Member Data Documentation

Definition at line 314 of file http.py.

Definition at line 322 of file http.py.

rpki.http.http_stream.log = log_method [static]

Definition at line 303 of file http.py.

Definition at line 372 of file http.py.

Definition at line 304 of file http.py.

Definition at line 314 of file http.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables