RPKI Engine
1.0
|
Public Member Functions | |
def | __init__ |
def | dns_error |
def | gotaddrinfo |
def | handle_close |
def | handle_connect |
def | handle_error |
def | handle_message |
def | handle_no_content_length |
def | handle_timeout |
def | send_request |
def | set_state |
def | start |
Public Attributes | |
addr | |
address | |
expect_close | |
host | |
port | |
queue | |
Static Public Attributes | |
parse_type = http_response | |
Stream parser should look for incoming HTTP response messages. | |
state = None | |
Application layer connection state. | |
timeout = default_client_timeout | |
Use the default client timeout value set in the module header. |
def rpki::http::http_client::__init__ | ( | self, | |
queue, | |||
hostport | |||
) |
def rpki::http::http_client::dns_error | ( | self, | |
e | |||
) |
Handle DNS lookup errors. For now, just whack the connection. Undoubtedly we should do something better with diagnostics here.
Definition at line 677 of file http.py.
References rpki::adns::dispatcher::handle_error(), rpki::http::http_stream::handle_error(), rpki::http::http_listener::handle_error(), and handle_error().
Referenced by start().
def rpki::http::http_client::gotaddrinfo | ( | self, | |
addrinfo | |||
) |
def rpki::http::http_client::handle_close | ( | self | ) |
Asyncore signaled connection close. If we were waiting for that to find the end of a response message, process the resulting message now; if we were waiting for the response to a request we sent, signal the error.
Reimplemented from rpki::http::http_stream.
Definition at line 772 of file http.py.
References rpki::http::http_stream::handle_body(), rpki::http::http_stream::log, rpki::http::http_listener::log, rpki::http::http_queue::log, and state.
def rpki::http::http_client::handle_connect | ( | self | ) |
Asyncore says socket has connected.
Definition at line 701 of file http.py.
References rpki::http::http_stream::log, rpki::http::http_listener::log, rpki::http::http_queue::log, rpki::async::timer::queue, queue, and set_state().
def rpki::http::http_client::handle_error | ( | self | ) |
Asyncore says something threw an exception. Log it, then shut down the connection and pass back the exception.
Reimplemented from rpki::http::http_stream.
Definition at line 805 of file http.py.
References rpki::adns::getaddrinfo::host, host, rpki::http::http_stream::log, rpki::http::http_listener::log, rpki::http::http_queue::log, and port.
Referenced by dns_error(), and handle_timeout().
def rpki::http::http_client::handle_message | ( | self | ) |
Handle incoming HTTP response message. Make sure we're in a state where we expect to see such a message (and allow the mysterious empty messages that Apache sends during connection close, no idea what that is supposed to be about). If everybody agrees that the connection should stay open, put it into an idle state; otherwise, arrange for the stream to shut down.
Definition at line 737 of file http.py.
References rpki::http::http_server::expect_close, expect_close, rpki::http::http_stream::log, rpki::http::http_listener::log, rpki::http::http_queue::log, irbe_cli::left_right_proto::msg, irbe_cli::publication_proto::msg, rpki::http::http_stream::msg, set_state(), state, and rpki::http::http_stream::update_timeout().
Referenced by rpki::http::http_stream::chunk_discard_trailer(), and rpki::http::http_stream::handle_body().
def rpki::http::http_client::handle_no_content_length | ( | self | ) |
def rpki::http::http_client::handle_timeout | ( | self | ) |
Connection idle timer has expired. Shut down connection in any case, noisily if we weren't idle.
Reimplemented from rpki::http::http_stream.
Definition at line 788 of file http.py.
References rpki::adns::dispatcher::handle_error(), rpki::http::http_stream::handle_error(), rpki::http::http_listener::handle_error(), handle_error(), rpki::http::http_stream::log, rpki::http::http_listener::log, rpki::http::http_queue::log, and state.
def rpki::http::http_client::send_request | ( | self, | |
msg | |||
) |
Queue up request message and kickstart connection.
Definition at line 726 of file http.py.
References rpki::http::http_server::expect_close, expect_close, rpki::http::http_stream::log, rpki::http::http_listener::log, rpki::http::http_queue::log, rpki::http::http_stream::restart(), rpki::http::http_queue::restart(), set_state(), and state.
Referenced by rpki::http::http_queue::restart().
def rpki::http::http_client::set_state | ( | self, | |
state | |||
) |
Set HTTP client connection state.
Definition at line 710 of file http.py.
References rpki::http::http_stream::log, rpki::http::http_listener::log, rpki::http::http_queue::log, and state.
Referenced by handle_connect(), handle_message(), and send_request().
def rpki::http::http_client::start | ( | self | ) |
Create socket and request a connection.
Definition at line 661 of file http.py.
References dns_error(), gotaddrinfo(), rpki::adns::getaddrinfo::host, host, rpki::http::localhost_addrinfo(), rpki::http::http_stream::log, rpki::http::http_listener::log, rpki::http::http_queue::log, and rpki::http::supported_address_families().
Definition at line 686 of file http.py.
Referenced by rpki::http::http_stream::__repr__(), and rpki::http::http_listener::__repr__().
Definition at line 652 of file http.py.
Referenced by handle_message(), and send_request().
Definition at line 652 of file http.py.
Referenced by handle_error(), and start().
rpki::http::http_client::parse_type = http_response [static] |
Definition at line 652 of file http.py.
Referenced by handle_error().
Definition at line 652 of file http.py.
Referenced by handle_connect(), rpki::http::http_queue::return_result(), and rpki::http::http_queue::send_request().
rpki::http::http_client::state = None [static] |
Application layer connection state.
Definition at line 650 of file http.py.
Referenced by handle_close(), handle_message(), handle_timeout(), send_request(), and set_state().
Use the default client timeout value set in the module header.
Definition at line 646 of file http.py.
Referenced by rpki::http::http_stream::update_timeout().