Inherits asynchat::async_chat.
Inherited by rpki.http.http_client, and rpki.http.http_server.
List of all members.
Detailed Description
Virtual class representing an HTTP message stream.
Definition at line 278 of file http.py.
Member Function Documentation
def rpki.http.http_stream.__init__ |
( |
|
self, |
|
|
|
sock = None | |
|
) |
| | |
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 377 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 389 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 399 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 361 of file http.py.
def rpki.http.http_stream.collect_incoming_data |
( |
|
self, |
|
|
|
data | |
|
) |
| | |
Buffer incoming data from asynchat.
Definition at line 313 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 328 of file http.py.
def rpki.http.http_stream.get_buffer |
( |
|
self |
) |
|
Consume data buffered from asynchat.
Definition at line 320 of file http.py.
def rpki.http.http_stream.handle_body |
( |
|
self |
) |
|
Hand normal (not chunked) message off to the application.
Definition at line 410 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.
Reimplemented in rpki.http.http_client.
Definition at line 440 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 417 of file http.py.
def rpki.http.http_stream.handle_timeout |
( |
|
self |
) |
|
def rpki.http.http_stream.restart |
( |
|
self |
) |
|
(Re)start HTTP message parser, reset timer.
Definition at line 291 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 300 of file http.py.
Member Data Documentation
The documentation for this class was generated from the following file: