GNU libmicrohttpd 1.0.1
|
#include </builddir/build/BUILD/libmicrohttpd-1.0.1-build/libmicrohttpd-1.0.1/src/lib/internal.h>
State kept for each HTTP request.
Request-specific values.
Meaningful for the current request only.
Definition at line 366 of file internal.h.
bool MHD_Request::client_aware |
Did we ever call the "default_handler" on this request? This flag determines if we have called the MHD_OPTION_NOTIFY_COMPLETED handler when the request finishes.
Definition at line 1199 of file internal.h.
Referenced by call_connection_handler(), connection_reset(), MHD_connection_close_(), process_request_body(), process_request_target(), and resume_suspended_connections().
void * MHD_Request::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 401 of file internal.h.
Referenced by call_connection_handler(), connection_reset(), MHD_connection_close_(), MHD_request_get_information_sz(), MHD_request_handle_idle_(), MHD_resume_suspended_connections_(), parse_initial_message_line(), process_request_body(), process_request_body(), process_request_target(), resume_suspended_connections(), and thread_main_handle_connection().
char* MHD_Request::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_REQUEST_HEADER_PART_RECEIVED or MHD_REQUEST_FOOTER_PART_RECEIVED.
Definition at line 456 of file internal.h.
Referenced by MHD_request_handle_idle_(), process_broken_line(), and process_header_line().
struct MHD_Connection* MHD_Request::connection |
Connection this request is associated with.
Definition at line 377 of file internal.h.
Referenced by build_header_response(), call_request_handler(), check_write_done(), connection_update_event_loop_info(), MHD_request_get_information_sz(), MHD_request_handle_idle_(), MHD_request_handle_read_(), MHD_request_handle_write_(), MHD_request_resume(), MHD_request_set_value(), parse_cookie_header(), parse_request_headers(), process_broken_line(), process_header_line(), process_request_body(), response_action(), suspend_action(), transmit_error_response(), try_grow_read_buffer(), try_ready_chunked_body(), and try_ready_normal_body().
size_t MHD_Request::continue_message_write_offset |
Position in the 100 CONTINUE message that we need to send when receiving http 1.1 requests.
Definition at line 544 of file internal.h.
Referenced by MHD_request_handle_idle_(), MHD_request_handle_write_(), and need_100_continue().
uint64_t MHD_Request::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 522 of file internal.h.
Referenced by check_and_grow_read_buffer_space(), handle_recv_no_space(), has_unprocessed_upload_body_data_in_buffer(), process_request_body(), and process_request_body().
uint64_t MHD_Request::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 516 of file internal.h.
Referenced by check_and_grow_read_buffer_space(), handle_recv_no_space(), has_unprocessed_upload_body_data_in_buffer(), process_request_body(), and process_request_body().
struct MHD_Daemon* MHD_Request::daemon |
Reference to the struct MHD_Daemon
.
Definition at line 372 of file internal.h.
Referenced by build_header_response(), call_request_handler(), MHD_parse_arguments_(), MHD_request_handle_idle_(), MHD_request_handle_read_(), MHD_request_handle_write_(), MHD_request_resume(), parse_cookie_header(), parse_initial_message_line(), parse_request_headers(), process_header_line(), process_request_body(), request_add_header(), response_action(), transmit_error_response(), try_grow_read_buffer(), and try_ready_chunked_body().
enum MHD_RequestEventLoopInfo MHD_Request::event_loop_info |
What is this request waiting for?
Definition at line 559 of file internal.h.
Referenced by connection_update_event_loop_info(), internal_get_fdset2(), MHD_connection_call_handlers_(), MHD_connection_mark_closed_(), and thread_main_handle_connection().
union MHD_StartOrSize MHD_Request::field_lines |
The union of the size of all request field lines (headers) and the starting point of the first request field line (the first header). Until MHD_CONNECTION_HEADERS_RECEIVED the start member is valid, staring with MHD_CONNECTION_HEADERS_RECEIVED the size member is valid. The size includes CRLF (or LR) characters, but does not include the terminating empty line.
Definition at line 1134 of file internal.h.
Referenced by get_no_space_err_status_code(), get_req_headers(), and switch_to_rq_headers_processing().
bool MHD_Request::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).
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). It is used only for requests, chunked encoding for response is indicated by rp_props.
Definition at line 580 of file internal.h.
Referenced by build_header_response(), check_and_grow_read_buffer_space(), handle_recv_no_space(), handle_req_footers_no_space(), has_unprocessed_upload_body_data_in_buffer(), MHD_connection_handle_idle(), MHD_connection_update_event_loop_info(), MHD_request_handle_idle_(), parse_connection_headers(), parse_request_headers(), process_request_body(), and process_request_body().
union MHD_HeadersProcessing MHD_Request::hdrs |
The data of the request line / request headers processing
Definition at line 1241 of file internal.h.
Referenced by get_req_header(), get_request_line(), get_request_line_inner(), process_request_target(), reset_rq_header_processing_state(), send_redirect_fixed_rq_target(), and switch_to_rq_headers_processing().
size_t MHD_Request::header_size |
Number of bytes we had in the HTTP header, set once we pass MHD_REQUEST_HEADERS_RECEIVED.
Number of bytes we had in the HTTP header, set once we pass MHD_CONNECTION_HEADERS_RECEIVED. This includes the request line, all request headers, the header section terminating empty line, with all CRLF (or LF) characters.
Definition at line 502 of file internal.h.
Referenced by get_req_headers(), MHD_get_connection_info(), MHD_request_get_information_sz(), and MHD_request_handle_idle_().
struct MHD_HTTP_Header* MHD_Request::headers_received |
Linked list of parsed headers.
Definition at line 388 of file internal.h.
Referenced by calculate_add_nonce(), check_argument_match(), digest_auth_check_all_inner(), find_auth_rq_header_(), MHD_get_connection_values(), MHD_get_connection_values_n(), MHD_lookup_connection_value_n(), MHD_lookup_header_token_ci(), MHD_lookup_header_token_ci(), MHD_request_get_values(), MHD_request_lookup_value(), MHD_request_set_value(), MHD_set_connection_value_n_nocheck_(), test_header(), and transmit_error_response_len().
struct MHD_HTTP_Req_Header* MHD_Request::headers_received |
Linked list of parsed headers.
Definition at line 1111 of file internal.h.
struct MHD_HTTP_Header* MHD_Request::headers_received_tail |
Tail of linked list of parsed headers.
Definition at line 393 of file internal.h.
Referenced by get_req_headers(), MHD_request_set_value(), MHD_set_connection_value_n_nocheck_(), and transmit_error_response_len().
struct MHD_HTTP_Req_Header* MHD_Request::headers_received_tail |
Tail of linked list of parsed headers.
Definition at line 1116 of file internal.h.
enum MHD_HTTP_Method MHD_Request::http_mthd |
The request method as enum.
Definition at line 1090 of file internal.h.
Referenced by calculate_add_nonce(), check_and_grow_read_buffer_space(), digest_auth_check_all_inner(), get_no_space_err_status_code(), get_request_line_inner(), handle_recv_no_space(), is_reply_body_needed(), MHD_queue_response(), and parse_http_std_method().
enum MHD_HTTP_Version MHD_Request::http_ver |
HTTP protocol version as enum.
Definition at line 1080 of file internal.h.
Referenced by build_header_response(), get_request_line(), handle_recv_no_space(), keepalive_possible(), MHD_connection_handle_idle(), MHD_queue_response(), need_100_continue(), parse_connection_headers(), parse_http_version(), and setup_reply_properties().
bool MHD_Request::in_cleanup |
Are we currently inside the "idle" handler (to avoid recursively invoking it).
Definition at line 571 of file internal.h.
Referenced by cleanup_connection().
bool MHD_Request::in_idle |
Are we currently inside the "idle" handler (to avoid recursively invoking it).
Definition at line 565 of file internal.h.
Referenced by cleanup_connection(), MHD_request_handle_idle_(), and response_action().
enum MHD_ConnKeepAlive MHD_Request::keepalive |
Close connection after sending response? Functions may change value from "Unknown" or "KeepAlive" to "Must close", but no functions reset value "Must Close" to any other value.
Definition at line 426 of file internal.h.
Referenced by build_header_response(), keepalive_possible(), MHD_request_handle_idle_(), and transmit_error_response().
char* MHD_Request::last |
Last incomplete header line during parsing of headers. Allocated in pool. Only valid if state is either MHD_REQUEST_HEADER_PART_RECEIVED or MHD_REQUEST_FOOTER_PART_RECEIVED.
Definition at line 447 of file internal.h.
Referenced by MHD_request_handle_idle_(), process_broken_line(), and process_header_line().
enum MHD_Method MHD_Request::method |
HTTP method, as an enum.
Definition at line 554 of file internal.h.
Referenced by build_header_response(), calculate_add_nonce(), call_connection_handler(), call_request_handler(), digest_auth_check_all_inner(), get_no_space_err_status_code(), get_req_headers(), get_request_line_inner(), MHD_request_handle_idle_(), parse_initial_message_line(), process_request_body(), process_request_body(), response_action(), and transmit_error_response_len().
const char* MHD_Request::method |
Request method. Should be GET/POST/etc. Allocated in pool.
Definition at line 1085 of file internal.h.
char* MHD_Request::method_s |
Request method as string. Should be GET/POST/etc. Allocated in pool.
Definition at line 407 of file internal.h.
Referenced by MHD_request_get_information_sz(), and parse_initial_message_line().
size_t MHD_Request::num_cr_sp_replaced |
Number of bare CR characters that were replaced with space characters in the request line or in the headers (field lines).
Definition at line 1231 of file internal.h.
Referenced by get_req_header(), get_req_headers(), get_request_line_inner(), and MHD_connection_handle_idle().
char* MHD_Request::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 433 of file internal.h.
Referenced by get_next_header_line(), MHD_request_handle_idle_(), MHD_request_handle_read_(), process_request_body(), and try_grow_read_buffer().
size_t MHD_Request::read_buffer_offset |
Position where we currently append data in read_buffer (last valid position).
Definition at line 480 of file internal.h.
Referenced by connection_update_event_loop_info(), get_next_header_line(), MHD_request_handle_idle_(), MHD_request_handle_read_(), and process_request_body().
size_t MHD_Request::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 474 of file internal.h.
Referenced by connection_update_event_loop_info(), get_next_header_line(), MHD_request_handle_idle_(), MHD_request_handle_read_(), and try_grow_read_buffer().
uint64_t MHD_Request::remaining_upload_size |
How many more bytes of the body do we expect to read? MHD_SIZE_UNKNOWN for unknown.
Definition at line 508 of file internal.h.
Referenced by check_and_grow_read_buffer_space(), has_unprocessed_upload_body_data_in_buffer(), MHD_connection_handle_idle(), MHD_connection_update_event_loop_info(), MHD_queue_response(), MHD_request_handle_idle_(), need_100_continue(), parse_connection_headers(), parse_request_headers(), process_request_body(), and process_request_body().
size_t MHD_Request::req_target_len |
The original length of the request target.
Definition at line 1106 of file internal.h.
Referenced by check_and_grow_read_buffer_space(), get_no_space_err_status_code(), get_request_line_inner(), process_request_target(), and send_redirect_fixed_rq_target().
struct MHD_Response* MHD_Request::response |
Response to return for this request, set once it is available.
Definition at line 383 of file internal.h.
Referenced by build_header_response(), call_request_handler(), cleanup_connection(), keepalive_possible(), MHD_connection_cleanup_(), MHD_connection_close_(), MHD_request_handle_idle_(), MHD_request_handle_write_(), MHD_resume_suspended_connections_(), need_100_continue(), parse_request_headers(), process_request_body(), response_action(), thread_main_handle_connection(), transmit_error_response(), try_ready_chunked_body(), and try_ready_normal_body().
uint64_t MHD_Request::response_write_position |
Current write position in the actual response (excluding headers, content only; should be 0 while sending headers).
Definition at line 529 of file internal.h.
Referenced by MHD_request_handle_idle_(), MHD_request_handle_write_(), response_action(), try_ready_chunked_body(), and try_ready_normal_body().
size_t MHD_Request::skipped_broken_lines |
The number of header lines skipped because they have no colon
Definition at line 1236 of file internal.h.
Referenced by get_req_header(), get_req_headers(), and MHD_connection_handle_idle().
bool MHD_Request::some_payload_processed |
Indicate that some of the upload payload data (from the currently processed chunk for chunked uploads) have been processed by the last call of the connection handler. If any data have been processed, but some data left in the buffer for further processing, then MHD will use zero timeout before the next data processing round. This allow the application handler process the data by the fixed portions or other way suitable for application developer. If no data have been processed, than MHD will wait for more data to come (as it makes no sense to call the same connection handler under the same conditions). However this is dangerous as if buffer is completely used then connection is aborted. Connection suspension should be used in such case.
Definition at line 1184 of file internal.h.
Referenced by handle_recv_no_space(), MHD_connection_update_event_loop_info(), and process_request_body().
enum MHD_REQUEST_STATE MHD_Request::state |
State in the FSM for this request.
Definition at line 549 of file internal.h.
Referenced by build_header_response(), check_write_done(), connection_update_event_loop_info(), MHD_connection_call_handlers_(), MHD_connection_mark_closed_(), MHD_request_get_information_sz(), MHD_request_handle_idle_(), MHD_request_handle_read_(), MHD_request_handle_write_(), parse_request_headers(), recv_param_adapter(), response_action(), send_param_adapter(), thread_main_handle_connection(), transmit_error_response(), try_ready_chunked_body(), and try_ready_normal_body().
const char * MHD_Request::url |
Requested URL (everything after "GET" only). Allocated in pool.
Definition at line 413 of file internal.h.
Referenced by calculate_add_nonce(), call_connection_handler(), call_request_handler(), check_uri_match(), connection_update_event_loop_info(), digest_auth_check_all_inner(), get_next_header_line(), get_request_line(), get_request_line_inner(), MHD_connection_handle_write(), MHD_request_handle_write_(), parse_initial_message_line(), process_request_body(), process_request_body(), process_request_target(), and transmit_error_response_len().
size_t MHD_Request::url_len |
The length of the url in characters, not including the terminating zero.
Definition at line 1101 of file internal.h.
Referenced by calculate_add_nonce(), check_uri_match(), digest_auth_check_all_inner(), get_request_line(), get_request_line_inner(), process_request_target(), and transmit_error_response_len().
const char* MHD_Request::version |
HTTP version string (i.e. http/1.1). Allocated in pool.
Definition at line 1075 of file internal.h.
Referenced by call_connection_handler(), get_req_headers(), get_request_line(), get_request_line_inner(), process_request_body(), process_request_body(), and transmit_error_response_len().
char* MHD_Request::version_s |
HTTP version string (i.e. http/1.1). Allocated in pool.
Definition at line 419 of file internal.h.
Referenced by build_header_response(), keepalive_possible(), MHD_request_get_information_sz(), MHD_request_handle_idle_(), need_100_continue(), parse_initial_message_line(), parse_request_headers(), and transmit_error_response().
char* MHD_Request::write_buffer |
Buffer for writing response (headers only). Allocated in pool.
Definition at line 439 of file internal.h.
Referenced by build_header_response(), check_write_done(), MHD_request_handle_write_(), and try_ready_chunked_body().
size_t MHD_Request::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 496 of file internal.h.
Referenced by build_header_response(), check_write_done(), MHD_request_handle_idle_(), MHD_request_handle_write_(), and try_ready_chunked_body().
size_t MHD_Request::write_buffer_send_offset |
Offset where we are with sending from write_buffer.
Definition at line 490 of file internal.h.
Referenced by build_header_response(), check_write_done(), MHD_request_handle_idle_(), MHD_request_handle_write_(), and try_ready_chunked_body().
size_t MHD_Request::write_buffer_size |
Size of write_buffer (in bytes).
Definition at line 485 of file internal.h.
Referenced by build_header_response(), check_write_done(), and try_ready_chunked_body().