|
GNU libmicrohttpd
0.9.5
|
#include <internal.h>
State kept for each HTTP request.
| struct sockaddr* MHD_Connection::addr |
Foreign address (of length addr_len). MALLOCED (not in pool!).
Definition at line 567 of file internal.h.
Referenced by MHD_get_connection_info(), MHD_add_connection(), and MHD_cleanup_connections().
| socklen_t MHD_Connection::addr_len |
Length of the foreign address.
Definition at line 627 of file internal.h.
Referenced by MHD_add_connection(), and MHD_cleanup_connections().
Did we ever call the "default_handler" on this connection? (this flag will determine if we call the 'notify_completed' handler when the connection closes down).
Definition at line 646 of file internal.h.
Referenced by MHD_connection_close(), call_connection_handler(), process_request_body(), and MHD_connection_handle_idle().
We allow the main application to associate some pointer with the connection. Here is where we store it. (MHD does not know or care what it is).
Definition at line 514 of file internal.h.
Referenced by MHD_connection_close(), parse_initial_message_line(), call_connection_handler(), process_request_body(), and MHD_connection_handle_idle().
| 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 HEADER_PART_RECEIVED or FOOTER_PART_RECEIVED.
Definition at line 561 of file internal.h.
Referenced by process_header_line(), and process_broken_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 639 of file internal.h.
Referenced by MHD_connection_handle_idle(), MHD_set_connection_option(), MHD_tls_connection_handle_idle(), MHD_add_connection(), and MHD_get_timeout().
Position in the 100 CONTINUE message that we need to send when receiving http 1.1 requests.
Definition at line 622 of file internal.h.
Referenced by need_100_continue(), MHD_connection_handle_write(), and MHD_connection_handle_idle().
| unsigned int 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 710 of file internal.h.
Referenced by process_request_body().
| unsigned int 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 704 of file internal.h.
Referenced by process_request_body().
| struct MHD_Daemon* MHD_Connection::daemon |
Reference to the MHD_Daemon struct.
Definition at line 479 of file internal.h.
Referenced by MHD_basic_auth_get_username_password(), MHD_connection_close(), connection_close_error(), try_ready_normal_body(), try_ready_chunked_body(), build_header_response(), transmit_error_response(), MHD_connection_get_pollfd(), connection_add_header(), parse_arguments(), parse_cookie_header(), parse_initial_message_line(), call_connection_handler(), process_request_body(), do_read(), do_write(), parse_connection_headers(), MHD_connection_handle_read(), MHD_connection_handle_write(), MHD_connection_handle_idle(), MHD_get_connection_info(), run_tls_handshake(), MHD_tls_connection_handle_idle(), MHD_handle_connection(), recv_param_adapter(), send_param_adapter(), MHD_add_connection(), check_nonce_nc(), check_argument_match(), MHD_digest_auth_check(), and MHD_queue_auth_fail_response().
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 696 of file internal.h.
Referenced by add_extra_headers(), process_request_body(), parse_connection_headers(), and MHD_connection_handle_idle().
Linked list of parsed headers.
Definition at line 484 of file internal.h.
Referenced by MHD_get_connection_values(), MHD_set_connection_value(), MHD_lookup_connection_value(), MHD_connection_handle_idle(), test_header(), check_argument_match(), and test_simple_large().
Tail of linked list of parsed headers.
Definition at line 489 of file internal.h.
Referenced by MHD_set_connection_value(), and MHD_connection_handle_idle().
| int(* MHD_Connection::idle_handler)(struct MHD_Connection *connection) |
Handler used for processing idle connection operations
Definition at line 725 of file internal.h.
Referenced by MHD_set_http_callbacks_(), MHD_set_https_callbacks(), MHD_handle_connection(), and MHD_select().
| char* MHD_Connection::last |
Last incomplete header line during parsing of headers. Allocated in pool. Only valid if state is either HEADER_PART_RECEIVED or FOOTER_PART_RECEIVED.
Definition at line 553 of file internal.h.
Referenced by process_header_line(), and process_broken_line().
Last time this connection had any activity (reading or writing).
Definition at line 633 of file internal.h.
Referenced by MHD_connection_handle_read(), MHD_connection_handle_write(), MHD_connection_handle_idle(), run_tls_handshake(), MHD_tls_connection_handle_idle(), MHD_handle_connection(), MHD_add_connection(), and MHD_get_timeout().
| char* MHD_Connection::method |
Request method. Should be GET/POST/etc. Allocated in pool.
Definition at line 520 of file internal.h.
Referenced by MHD_queue_response(), parse_initial_message_line(), call_connection_handler(), process_request_body(), MHD_connection_handle_idle(), MHD_digest_auth_check(), and MHD_queue_auth_fail_response().
| struct MHD_Connection* MHD_Connection::next |
This is a doubly-linked list.
Definition at line 469 of file internal.h.
Referenced by MHD_get_fdset(), MHD_get_timeout(), MHD_select(), and close_all_connections().
| pthread_t MHD_Connection::pid |
Thread for this connection (if we are using one thread per connection).
Definition at line 573 of file internal.h.
Referenced by MHD_add_connection(), MHD_cleanup_connections(), and close_all_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 506 of file internal.h.
Referenced by MHD_set_connection_value(), try_ready_chunked_body(), try_grow_read_buffer(), build_header_response(), MHD_connection_get_pollfd(), get_next_header_line(), parse_cookie_header(), check_write_done(), process_broken_line(), MHD_connection_handle_read(), MHD_connection_handle_idle(), MHD_add_connection(), and MHD_cleanup_connections().
| struct MHD_Connection* MHD_Connection::prev |
This is a doubly-linked list.
Definition at line 474 of file internal.h.
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 540 of file internal.h.
Referenced by try_grow_read_buffer(), get_next_header_line(), process_request_body(), do_read(), MHD_connection_handle_read(), and MHD_connection_handle_idle().
Position where we currently append data in read_buffer (last valid position).
Definition at line 587 of file internal.h.
Referenced by MHD_connection_get_pollfd(), get_next_header_line(), process_request_body(), do_read(), MHD_connection_handle_read(), and MHD_connection_handle_idle().
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 581 of file internal.h.
Referenced by try_grow_read_buffer(), MHD_connection_get_pollfd(), get_next_header_line(), do_read(), MHD_connection_handle_read(), and MHD_connection_handle_idle().
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 662 of file internal.h.
Referenced by MHD_queue_response(), MHD_connection_close(), build_header_response(), transmit_error_response(), MHD_connection_get_pollfd(), do_read(), parse_connection_headers(), MHD_connection_handle_read(), MHD_connection_handle_idle(), and close_all_connections().
| int(* MHD_Connection::read_handler)(struct MHD_Connection *connection) |
Handler used for processing read connection operations
Definition at line 715 of file internal.h.
Referenced by MHD_set_http_callbacks_(), MHD_set_https_callbacks(), MHD_handle_connection(), and MHD_select().
Function used for reading HTTP request stream.
Definition at line 730 of file internal.h.
Referenced by do_read(), and MHD_add_connection().
How many more bytes of the body do we expect to read? "-1" for unknown.
Definition at line 609 of file internal.h.
Referenced by process_request_body(), parse_connection_headers(), and MHD_connection_handle_idle().
| struct MHD_Response* MHD_Connection::response |
Response to transmit (initially NULL).
Definition at line 494 of file internal.h.
Referenced by MHD_queue_response(), need_100_continue(), try_ready_normal_body(), try_ready_chunked_body(), add_extra_headers(), build_header_response(), transmit_error_response(), call_connection_handler(), process_request_body(), parse_connection_headers(), MHD_connection_handle_write(), MHD_connection_handle_idle(), MHD_handle_connection(), send_param_adapter(), and MHD_cleanup_connections().
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 687 of file internal.h.
Current write position in the actual response (excluding headers, content only; should be 0 while sending headers).
Definition at line 616 of file internal.h.
Referenced by MHD_queue_response(), try_ready_normal_body(), try_ready_chunked_body(), MHD_connection_handle_write(), MHD_connection_handle_idle(), and send_param_adapter().
| unsigned int MHD_Connection::responseCode |
HTTP response code. Only valid if response object is already set.
Definition at line 678 of file internal.h.
Referenced by MHD_queue_response(), build_header_response(), and MHD_connection_handle_idle().
Function used for writing HTTP response stream.
Definition at line 735 of file internal.h.
Referenced by do_write(), MHD_connection_handle_write(), and MHD_add_connection().
Socket for this connection. Set to -1 if this connection has died (daemon should clean up in that case).
Definition at line 653 of file internal.h.
Referenced by MHD_queue_response(), MHD_connection_close(), MHD_connection_get_pollfd(), do_read(), MHD_connection_handle_idle(), MHD_handle_connection(), recv_param_adapter(), send_param_adapter(), MHD_add_connection(), MHD_cleanup_connections(), MHD_select(), and close_all_connections().
State in the FSM for this connection.
Definition at line 672 of file internal.h.
Referenced by MHD_queue_response(), MHD_connection_close(), try_ready_normal_body(), try_ready_chunked_body(), build_header_response(), transmit_error_response(), MHD_connection_get_pollfd(), check_write_done(), parse_connection_headers(), MHD_connection_handle_read(), MHD_connection_handle_write(), MHD_connection_handle_idle(), run_tls_handshake(), MHD_tls_connection_handle_idle(), MHD_handle_connection(), recv_param_adapter(), send_param_adapter(), and MHD_add_connection().
Set to MHD_YES if the thread has been joined.
Definition at line 667 of file internal.h.
Referenced by MHD_cleanup_connections(), and close_all_connections().
| char* MHD_Connection::url |
Requested URL (everything after "GET" only). Allocated in pool.
Definition at line 526 of file internal.h.
Referenced by MHD_connection_get_pollfd(), get_next_header_line(), parse_initial_message_line(), call_connection_handler(), process_request_body(), MHD_connection_handle_idle(), MHD_digest_auth_check(), and MHD_queue_auth_fail_response().
| char* MHD_Connection::version |
HTTP version string (i.e. http/1.1). Allocated in pool.
Definition at line 532 of file internal.h.
Referenced by need_100_continue(), add_extra_headers(), build_header_response(), transmit_error_response(), parse_initial_message_line(), call_connection_handler(), process_request_body(), parse_connection_headers(), and MHD_connection_handle_idle().
Buffer for writing response (headers only). Allocated in pool.
Definition at line 546 of file internal.h.
Referenced by try_ready_chunked_body(), build_header_response(), do_write(), check_write_done(), and MHD_connection_handle_idle().
Last valid location in write_buffer (where do we append and up to where is it safe to send?)
Definition at line 603 of file internal.h.
Referenced by try_ready_chunked_body(), build_header_response(), do_write(), check_write_done(), MHD_connection_handle_idle(), and send_param_adapter().
Offset where we are with sending from write_buffer.
Definition at line 597 of file internal.h.
Referenced by try_ready_chunked_body(), build_header_response(), do_write(), check_write_done(), MHD_connection_handle_idle(), and send_param_adapter().
Size of write_buffer (in bytes).
Definition at line 592 of file internal.h.
Referenced by try_ready_chunked_body(), build_header_response(), check_write_done(), and MHD_connection_handle_idle().
| int(* MHD_Connection::write_handler)(struct MHD_Connection *connection) |
Handler used for processing write connection operations
Definition at line 720 of file internal.h.
Referenced by MHD_set_http_callbacks_(), MHD_set_https_callbacks(), MHD_handle_connection(), and MHD_select().