GNU libmicrohttpd 1.0.2
Loading...
Searching...
No Matches
MHD_Request Struct Reference

#include </builddir/build/BUILD/libmicrohttpd-1.0.2-build/libmicrohttpd-1.0.2/src/microhttpd/internal.h>

Data Fields

const char * version
enum MHD_HTTP_Version http_ver
const char * method
enum MHD_HTTP_Method http_mthd
const char * url
size_t url_len
size_t req_target_len
struct MHD_HTTP_Req_Headerheaders_received
struct MHD_HTTP_Req_Headerheaders_received_tail
size_t header_size
union MHD_StartOrSize field_lines
uint64_t remaining_upload_size
bool have_chunked_upload
uint64_t current_chunk_size
uint64_t current_chunk_offset
bool some_payload_processed
void * client_context
bool client_aware
size_t num_cr_sp_replaced
size_t skipped_broken_lines
union MHD_HeadersProcessing hdrs

Detailed Description

Request-specific values.

Meaningful for the current request only.

Definition at line 1069 of file internal.h.

Field Documentation

◆ client_aware

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().

◆ client_context

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 1192 of file internal.h.

Referenced by call_connection_handler(), connection_reset(), MHD_connection_close_(), process_request_body(), process_request_target(), and resume_suspended_connections().

◆ current_chunk_offset

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 1167 of file internal.h.

Referenced by check_and_grow_read_buffer_space(), handle_recv_no_space(), has_unprocessed_upload_body_data_in_buffer(), and process_request_body().

◆ current_chunk_size

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 1161 of file internal.h.

Referenced by check_and_grow_read_buffer_space(), handle_recv_no_space(), has_unprocessed_upload_body_data_in_buffer(), and process_request_body().

◆ field_lines

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().

◆ have_chunked_upload

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). It is used only for requests, chunked encoding for response is indicated by rp_props.

Definition at line 1152 of file internal.h.

Referenced by 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(), parse_connection_headers(), and process_request_body().

◆ hdrs

union MHD_HeadersProcessing MHD_Request::hdrs

◆ header_size

size_t MHD_Request::header_size

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 1124 of file internal.h.

Referenced by get_req_headers(), and MHD_get_connection_info().

◆ headers_received

◆ headers_received_tail

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.

Referenced by get_req_headers(), MHD_set_connection_value_n_nocheck_(), and transmit_error_response_len().

◆ http_mthd

◆ http_ver

◆ method

const char* MHD_Request::method

◆ num_cr_sp_replaced

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().

◆ remaining_upload_size

uint64_t MHD_Request::remaining_upload_size

◆ req_target_len

size_t MHD_Request::req_target_len

◆ skipped_broken_lines

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().

◆ some_payload_processed

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().

◆ url

◆ url_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().

◆ version

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(), and transmit_error_response_len().


The documentation for this struct was generated from the following file: