GNU libmicrohttpd
0.9.29
|
#include </builddir/build/BUILD/libmicrohttpd-0.9.52/src/microhttpd/internal.h>
State kept for each HTTP request.
Definition at line 559 of file internal.h.
struct sockaddr* MHD_Connection::addr |
Foreign address (of length addr_len). MALLOCED (not in pool!).
Definition at line 696 of file internal.h.
Referenced by internal_add_connection(), MHD_cleanup_connections(), and MHD_get_connection_info().
socklen_t MHD_Connection::addr_len |
Length of the foreign address.
Definition at line 756 of file internal.h.
Referenced by internal_add_connection(), and MHD_cleanup_connections().
int MHD_Connection::client_aware |
Did we ever call the "default_handler" on this connection? (this flag will determine if we call the MHD_OPTION_NOTIFY_COMPLETED handler when the connection closes down).
Definition at line 775 of file internal.h.
Referenced by call_connection_handler(), MHD_connection_close_(), MHD_connection_handle_idle(), parse_initial_message_line(), process_request_body(), and thread_main_handle_connection().
void* MHD_Connection::client_context |
We allow the main application to associate some pointer with the HTTP request, which is passed to each MHD_AccessHandlerCallback and some other API calls. Here is where we store it. (MHD does not know or care what it is).
Definition at line 634 of file internal.h.
Referenced by call_connection_handler(), MHD_connection_close_(), MHD_connection_handle_idle(), MHD_response_execute_upgrade_(), parse_initial_message_line(), process_request_body(), and thread_main_handle_connection().
char* MHD_Connection::colon |
Position after the colon on the last incomplete header line during parsing of headers. Allocated in pool. Only valid if state is either MHD_CONNECTION_HEADER_PART_RECEIVED or MHD_CONNECTION_FOOTER_PART_RECEIVED.
Definition at line 690 of file internal.h.
Referenced by process_broken_line(), and process_header_line().
unsigned int MHD_Connection::connection_timeout |
After how many seconds of inactivity should this connection time out? Zero for no timeout.
Definition at line 768 of file internal.h.
Referenced by cleanup_connection(), close_connection(), internal_add_connection(), MHD_connection_handle_idle(), MHD_get_timeout(), MHD_set_connection_option(), MHD_suspend_connection(), MHD_tls_connection_handle_idle(), resume_suspended_connections(), and update_last_activity().
size_t MHD_Connection::continue_message_write_offset |
Position in the 100 CONTINUE message that we need to send when receiving http 1.1 requests.
Definition at line 751 of file internal.h.
Referenced by MHD_connection_handle_idle(), MHD_connection_handle_write(), and need_100_continue().
size_t MHD_Connection::current_chunk_offset |
If we are receiving with chunked encoding, where are we currently with respect to the current chunk (at what offset / position)?
Definition at line 856 of file internal.h.
Referenced by process_request_body().
size_t MHD_Connection::current_chunk_size |
If we are receiving with chunked encoding, where are we right now? Set to 0 if we are waiting to receive the chunk size; otherwise, this is the size of the current chunk. A value of zero is also used when we're at the end of the chunks.
Definition at line 850 of file internal.h.
Referenced by process_request_body().
struct MHD_Daemon* MHD_Connection::daemon |
Reference to the MHD_Daemon struct.
Definition at line 601 of file internal.h.
Referenced by build_header_response(), call_connection_handler(), call_handlers(), check_argument_match(), check_nonce_nc(), cleanup_connection(), close_connection(), connection_add_header(), connection_close_error(), internal_add_connection(), MHD_basic_auth_get_username_password(), MHD_cleanup_upgraded_connection_(), MHD_connection_close_(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_connection_handle_write(), MHD_connection_update_event_loop_info(), MHD_digest_auth_check(), MHD_get_connection_info(), MHD_ip_limit_del(), MHD_parse_arguments_(), MHD_queue_auth_fail_response(), MHD_queue_basic_auth_fail_response(), MHD_queue_response(), MHD_response_execute_upgrade_(), MHD_resume_connection(), MHD_set_connection_option(), MHD_suspend_connection(), MHD_tls_connection_handle_idle(), MHD_upgrade_action(), parse_connection_headers(), parse_cookie_header(), parse_initial_message_line(), process_request_body(), run_tls_handshake(), send_param_adapter(), thread_main_connection_upgrade(), thread_main_handle_connection(), transmit_error_response(), try_grow_read_buffer(), try_ready_chunked_body(), try_ready_normal_body(), and update_last_activity().
enum MHD_ConnectionEventLoopInfo MHD_Connection::event_loop_info |
What is this connection waiting for?
Definition at line 818 of file internal.h.
Referenced by close_connection(), MHD_connection_close_(), MHD_connection_handle_idle(), MHD_connection_update_event_loop_info(), MHD_get_fdset2(), MHD_poll(), MHD_select(), and thread_main_handle_connection().
int MHD_Connection::have_chunked_upload |
Are we receiving with chunked encoding? This will be set to MHD_YES after we parse the headers and are processing the body with chunks. After we are done with the body and we are processing the footers; once the footers are also done, this will be set to MHD_NO again (before the final call to the handler).
Definition at line 842 of file internal.h.
Referenced by build_header_response(), MHD_connection_handle_idle(), parse_connection_headers(), and process_request_body().
struct MHD_HTTP_Header* MHD_Connection::headers_received |
Linked list of parsed headers.
Definition at line 606 of file internal.h.
Referenced by check_argument_match(), MHD_connection_handle_idle(), MHD_get_connection_values(), MHD_lookup_connection_value(), MHD_set_connection_value(), and test_header().
struct MHD_HTTP_Header* MHD_Connection::headers_received_tail |
Tail of linked list of parsed headers.
Definition at line 611 of file internal.h.
Referenced by MHD_connection_handle_idle(), and MHD_set_connection_value().
int(* MHD_Connection::idle_handler) (struct MHD_Connection *connection) |
Handler used for processing idle connection operations
Definition at line 871 of file internal.h.
Referenced by call_handlers(), MHD_poll(), MHD_set_http_callbacks_(), MHD_set_https_callbacks(), MHD_upgrade_action(), and thread_main_handle_connection().
int MHD_Connection::in_idle |
Are we currently inside the "idle" handler (to avoid recursively invoking it).
Definition at line 801 of file internal.h.
Referenced by cleanup_connection(), MHD_connection_handle_idle(), and MHD_queue_response().
char* MHD_Connection::last |
Last incomplete header line during parsing of headers. Allocated in pool. Only valid if state is either MHD_CONNECTION_HEADER_PART_RECEIVED or MHD_CONNECTION_FOOTER_PART_RECEIVED.
Definition at line 681 of file internal.h.
Referenced by process_broken_line(), and process_header_line().
time_t MHD_Connection::last_activity |
Last time this connection had any activity (reading or writing).
Definition at line 762 of file internal.h.
Referenced by internal_add_connection(), MHD_connection_handle_idle(), MHD_get_timeout(), MHD_tls_connection_handle_idle(), run_tls_handshake(), thread_main_handle_connection(), and update_last_activity().
char* MHD_Connection::method |
Request method. Should be GET/POST/etc. Allocated in pool.
Definition at line 648 of file internal.h.
Referenced by build_header_response(), call_connection_handler(), MHD_connection_handle_idle(), MHD_digest_auth_check(), MHD_queue_auth_fail_response(), MHD_queue_response(), parse_initial_message_line(), and process_request_body().
struct MHD_Connection* MHD_Connection::next |
Next pointer for the DLL describing our IO state.
Definition at line 577 of file internal.h.
Referenced by close_all_connections(), MHD_get_fdset2(), MHD_poll(), MHD_run_from_select(), MHD_select(), and resume_suspended_connections().
struct MHD_Connection* MHD_Connection::nextX |
Next pointer for the XDLL organizing connections by timeout. This DLL can be either the 'manual_timeout_head/manual_timeout_tail' or the 'normal_timeout_head/normal_timeout_tail', depending on whether a custom timeout is set for the connection.
Definition at line 591 of file internal.h.
Referenced by MHD_get_timeout(), and MHD_poll().
MHD_thread_handle_ MHD_Connection::pid |
Thread handle for this connection (if we are using one thread per connection).
Definition at line 702 of file internal.h.
Referenced by close_all_connections(), internal_add_connection(), and MHD_cleanup_connections().
struct MemoryPool* MHD_Connection::pool |
The memory pool is created whenever we first read from the TCP stream and destroyed at the end of each request (and re-created for the next request). In the meantime, this pointer is NULL. The pool is used for all connection-related data except for the response (which maybe shared between connections) and the IP address (which persists across individual requests).
Definition at line 626 of file internal.h.
Referenced by build_header_response(), check_write_done(), internal_add_connection(), MHD_cleanup_connections(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_response_execute_upgrade_(), MHD_set_connection_value(), parse_cookie_header(), process_broken_line(), try_grow_read_buffer(), and try_ready_chunked_body().
struct MHD_Connection* MHD_Connection::prev |
Previous pointer for the DLL describing our IO state.
Definition at line 582 of file internal.h.
struct MHD_Connection* MHD_Connection::prevX |
Previous pointer for the XDLL organizing connections by timeout.
Definition at line 596 of file internal.h.
Referenced by MHD_poll().
char* MHD_Connection::read_buffer |
Buffer for reading requests. Allocated in pool. Actually one byte larger than read_buffer_size (if non-NULL) to allow for 0-termination.
Definition at line 667 of file internal.h.
Referenced by do_read(), get_next_header_line(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_response_execute_upgrade_(), process_request_body(), and try_grow_read_buffer().
size_t MHD_Connection::read_buffer_offset |
Position where we currently append data in read_buffer (last valid position).
Definition at line 716 of file internal.h.
Referenced by do_read(), get_next_header_line(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_connection_update_event_loop_info(), MHD_get_fdset2(), MHD_poll(), MHD_response_execute_upgrade_(), MHD_select(), process_request_body(), and thread_main_handle_connection().
size_t MHD_Connection::read_buffer_size |
Size of read_buffer (in bytes). This value indicates how many bytes we're willing to read into the buffer; the real buffer is one byte longer to allow for adding zero-termination (when needed).
Definition at line 710 of file internal.h.
Referenced by do_read(), get_next_header_line(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_connection_update_event_loop_info(), MHD_get_fdset2(), MHD_poll(), MHD_select(), thread_main_handle_connection(), and try_grow_read_buffer().
int MHD_Connection::read_closed |
Has this socket been closed for reading (i.e. other side closed the connection)? If so, we must completely close the connection once we are done sending our response (and stop trying to read from this socket).
Definition at line 790 of file internal.h.
Referenced by build_header_response(), do_read(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_connection_update_event_loop_info(), MHD_queue_response(), parse_connection_headers(), and transmit_error_response().
int(* MHD_Connection::read_handler) (struct MHD_Connection *connection) |
Handler used for processing read connection operations
Definition at line 861 of file internal.h.
Referenced by call_handlers(), MHD_set_http_callbacks_(), and MHD_set_https_callbacks().
ReceiveCallback MHD_Connection::recv_cls |
Function used for reading HTTP request stream.
Definition at line 876 of file internal.h.
Referenced by do_read(), and internal_add_connection().
uint64_t MHD_Connection::remaining_upload_size |
How many more bytes of the body do we expect to read? MHD_SIZE_UNKNOWN for unknown.
Definition at line 738 of file internal.h.
Referenced by MHD_connection_handle_idle(), parse_connection_headers(), and process_request_body().
struct MHD_Response* MHD_Connection::response |
Response to transmit (initially NULL).
Definition at line 616 of file internal.h.
Referenced by build_header_response(), call_connection_handler(), call_handlers(), cleanup_connection(), keepalive_possible(), MHD_cleanup_connections(), MHD_connection_handle_idle(), MHD_connection_handle_write(), MHD_queue_response(), MHD_upgrade_action(), need_100_continue(), parse_connection_headers(), process_request_body(), send_param_adapter(), thread_main_handle_connection(), transmit_error_response(), try_ready_chunked_body(), and try_ready_normal_body().
int MHD_Connection::response_unready |
Set to MHD_YES if the response's content reader callback failed to provide data the last time we tried to read from it. In that case, the write socket should be marked as unready until the CRC call succeeds.
Definition at line 833 of file internal.h.
uint64_t MHD_Connection::response_write_position |
Current write position in the actual response (excluding headers, content only; should be 0 while sending headers).
Definition at line 745 of file internal.h.
Referenced by MHD_connection_handle_idle(), MHD_connection_handle_write(), MHD_queue_response(), send_param_adapter(), try_ready_chunked_body(), and try_ready_normal_body().
unsigned int MHD_Connection::responseCode |
HTTP response code. Only valid if response object is already set.
Definition at line 824 of file internal.h.
Referenced by build_header_response(), MHD_connection_handle_idle(), and MHD_queue_response().
int MHD_Connection::resuming |
Is the connection wanting to resume?
Definition at line 924 of file internal.h.
Referenced by cleanup_connection(), MHD_resume_connection(), and resume_suspended_connections().
TransmitCallback MHD_Connection::send_cls |
Function used for writing HTTP response stream.
Definition at line 881 of file internal.h.
Referenced by do_write(), internal_add_connection(), and MHD_connection_handle_write().
void* MHD_Connection::socket_context |
We allow the main application to associate some pointer with the TCP connection (which may span multiple HTTP requests). Here is where we store it. (MHD does not know or care what it is). The location is given to the MHD_NotifyConnectionCallback and also accessible via MHD_CONNECTION_INFO_SOCKET_CONTEXT.
Definition at line 643 of file internal.h.
Referenced by internal_add_connection(), MHD_cleanup_connections(), and MHD_get_connection_info().
MHD_socket MHD_Connection::socket_fd |
Socket for this connection. Set to MHD_INVALID_SOCKET if this connection has died (daemon should clean up in that case).
Definition at line 782 of file internal.h.
Referenced by close_all_connections(), internal_add_connection(), MHD_cleanup_connections(), MHD_cleanup_upgraded_connection_(), MHD_connection_close_(), MHD_connection_handle_idle(), MHD_get_connection_info(), MHD_get_fdset(), MHD_get_fdset2(), MHD_response_execute_upgrade_(), MHD_run_from_select(), MHD_select(), MHD_suspend_connection(), MHD_upgrade_action(), recv_param_adapter(), send_param_adapter(), socket_start_extra_buffering(), socket_start_no_buffering(), socket_start_no_buffering_flush(), socket_start_normal_buffering(), thread_main_connection_upgrade(), and thread_main_handle_connection().
enum MHD_CONNECTION_STATE MHD_Connection::state |
State in the FSM for this connection.
Definition at line 813 of file internal.h.
Referenced by build_header_response(), check_write_done(), internal_add_connection(), MHD_connection_close_(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_connection_handle_write(), MHD_connection_update_event_loop_info(), MHD_poll(), MHD_queue_response(), MHD_tls_connection_handle_idle(), MHD_upgrade_action(), parse_connection_headers(), recv_param_adapter(), run_tls_handshake(), send_param_adapter(), thread_main_connection_upgrade(), thread_main_handle_connection(), transmit_error_response(), try_ready_chunked_body(), and try_ready_normal_body().
int MHD_Connection::suspended |
Is the connection suspended?
Definition at line 919 of file internal.h.
Referenced by cleanup_connection(), MHD_connection_handle_idle(), MHD_get_connection_info(), MHD_set_connection_option(), MHD_suspend_connection(), process_request_body(), and resume_suspended_connections().
int MHD_Connection::thread_joined |
Set to MHD_YES if the thread has been joined.
Definition at line 795 of file internal.h.
Referenced by close_all_connections(), and MHD_cleanup_connections().
struct MHD_UpgradeResponseHandle* MHD_Connection::urh |
If this connection was upgraded and if we are using MHD_USE_THREAD_PER_CONNECTION or MHD_USE_TLS, this points to the upgrade response details such that the thread_main_connection_upgrade()-logic can perform the bi-directional forwarding.
Definition at line 890 of file internal.h.
Referenced by MHD_cleanup_upgraded_connection_(), MHD_response_execute_upgrade_(), and thread_main_connection_upgrade().
const char* MHD_Connection::url |
Requested URL (everything after "GET" only). Allocated in pool.
Definition at line 654 of file internal.h.
Referenced by call_connection_handler(), get_next_header_line(), MHD_connection_handle_idle(), MHD_connection_update_event_loop_info(), MHD_digest_auth_check(), MHD_queue_auth_fail_response(), parse_initial_message_line(), and process_request_body().
char* MHD_Connection::version |
HTTP version string (i.e. http/1.1). Allocated in pool.
Definition at line 660 of file internal.h.
Referenced by build_header_response(), call_connection_handler(), keepalive_possible(), MHD_connection_handle_idle(), need_100_continue(), parse_connection_headers(), parse_initial_message_line(), process_request_body(), and transmit_error_response().
char* MHD_Connection::write_buffer |
Buffer for writing response (headers only). Allocated in pool.
Definition at line 673 of file internal.h.
Referenced by build_header_response(), check_write_done(), do_write(), MHD_connection_handle_idle(), and try_ready_chunked_body().
size_t MHD_Connection::write_buffer_append_offset |
Last valid location in write_buffer (where do we append and up to where is it safe to send?)
Definition at line 732 of file internal.h.
Referenced by build_header_response(), check_write_done(), do_write(), MHD_connection_handle_idle(), send_param_adapter(), and try_ready_chunked_body().
size_t MHD_Connection::write_buffer_send_offset |
Offset where we are with sending from write_buffer.
Definition at line 726 of file internal.h.
Referenced by build_header_response(), check_write_done(), do_write(), MHD_connection_handle_idle(), send_param_adapter(), and try_ready_chunked_body().
size_t MHD_Connection::write_buffer_size |
Size of write_buffer (in bytes).
Definition at line 721 of file internal.h.
Referenced by build_header_response(), check_write_done(), MHD_connection_handle_idle(), and try_ready_chunked_body().
int(* MHD_Connection::write_handler) (struct MHD_Connection *connection) |
Handler used for processing write connection operations
Definition at line 866 of file internal.h.
Referenced by call_handlers(), MHD_set_http_callbacks_(), and MHD_set_https_callbacks().