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

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

Data Fields

struct MHD_Connectionnext
struct MHD_Connectionprev
struct MHD_ConnectionnextX
struct MHD_ConnectionprevX
struct MHD_Daemondaemon
struct MHD_Request rq
struct MHD_Reply rp
struct MemoryPool * pool
void * socket_context
enum MHD_ConnKeepAlive keepalive
char * read_buffer
char * write_buffer
struct sockaddr_storage * addr
size_t read_buffer_size
size_t read_buffer_offset
size_t write_buffer_size
size_t write_buffer_send_offset
size_t write_buffer_append_offset
size_t continue_message_write_offset
socklen_t addr_len
uint64_t last_activity
uint64_t connection_timeout_ms
MHD_socket socket_fd
enum MHD_tristate is_nonip
bool sk_nonblck
bool sk_spipe_suppress
enum MHD_tristate sk_corked
enum MHD_tristate sk_nodelay
bool read_closed
bool stop_with_error
bool discard_request
bool in_idle
bool in_cleanup
enum MHD_CONNECTION_STATE state
enum MHD_ConnectionEventLoopInfo event_loop_info
ReceiveCallback recv_cls
bool suspended
bool in_access_handler
volatile bool resuming
union MHD_ConnectionInfo connection_info_dummy

Detailed Description

State kept for each HTTP request.

Definition at line 1318 of file internal.h.

Field Documentation

◆ addr

struct sockaddr_storage* MHD_Connection::addr

Foreign address (of length addr_len). MALLOCED (not in pool!).

Definition at line 1415 of file internal.h.

Referenced by calculate_add_nonce(), digest_auth_check_all_inner(), internal_add_connection(), MHD_cleanup_connections(), MHD_get_connection_info(), new_connection_prepare_(), and new_connection_process_().

◆ addr_len

socklen_t MHD_Connection::addr_len

◆ connection_info_dummy

union MHD_ConnectionInfo MHD_Connection::connection_info_dummy

Special member to be returned by MHD_get_connection_info()

Definition at line 1626 of file internal.h.

Referenced by MHD_get_connection_info().

◆ connection_timeout_ms

uint64_t MHD_Connection::connection_timeout_ms

◆ continue_message_write_offset

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

Referenced by connection_reset(), MHD_connection_handle_idle(), MHD_connection_handle_write(), and MHD_connection_set_initial_state_().

◆ daemon

struct MHD_Daemon* MHD_Connection::daemon

Reference to the MHD_Daemon struct.

Definition at line 1360 of file internal.h.

Referenced by build_header_response(), calculate_add_nonce(), calculate_add_nonce_with_retry(), call_connection_handler(), call_handlers(), check_and_grow_read_buffer_space(), check_connection_reply(), check_nonce_nc(), check_uri_match(), cleanup_connection(), close_all_connections(), close_connection(), connection_add_header(), connection_check_timedout(), connection_close_error(), connection_reset(), digest_auth_check_all(), digest_auth_check_all_inner(), get_req_header(), get_req_headers(), get_request_line(), get_request_line_inner(), handle_recv_no_space(), internal_add_connection(), internal_get_fdset2(), internal_run_from_select(), internal_suspend_connection_(), MHD_basic_auth_get_username_password(), MHD_basic_auth_get_username_password3(), MHD_cleanup_connections(), MHD_connection_close_(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_connection_handle_write(), MHD_connection_mark_closed_(), MHD_connection_set_cork_state_(), MHD_connection_set_initial_state_(), MHD_connection_set_nodelay_state_(), MHD_connection_update_event_loop_info(), MHD_digest_auth_check_digest3(), MHD_get_connection_info(), MHD_get_timeout(), MHD_get_timeout64(), MHD_parse_arguments_(), MHD_queue_basic_auth_required_response3(), MHD_queue_response(), MHD_resume_connection(), MHD_run_from_select(), MHD_run_from_select2(), MHD_run_tls_handshake_(), MHD_send_data_(), MHD_send_hdr_and_body_(), MHD_send_iovec_(), MHD_set_connection_option(), MHD_stop_daemon(), MHD_suspend_connection(), MHD_update_last_activity_(), new_connection_prepare_(), new_connection_process_(), new_connections_list_process_(), parse_connection_headers(), post_send_setopt(), process_request_body(), process_request_target(), queue_auth_required_response3_inner(), resume_suspended_connections(), send_redirect_fixed_rq_target(), transmit_error_response_len(), try_grow_read_buffer(), unescape_wrapper(), and zero_send_().

◆ discard_request

bool MHD_Connection::discard_request

Response queued early, before the request is fully processed, the client upload is rejected. The connection cannot be reused for additional requests as the current request is incompletely read and it is unclear where is the initial byte of the next request.

Definition at line 1535 of file internal.h.

Referenced by check_and_grow_read_buffer_space(), connection_close_error(), connection_reset(), get_req_headers(), keepalive_possible(), MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_connection_update_event_loop_info(), MHD_queue_response(), and transmit_error_response_len().

◆ event_loop_info

◆ in_access_handler

bool MHD_Connection::in_access_handler

Are we currently in the MHD_AccessHandlerCallback for this connection (and thus eligible to receive calls to MHD_queue_response()?).

Definition at line 1616 of file internal.h.

Referenced by call_connection_handler(), MHD_queue_response(), process_request_body(), and transmit_error_response_len().

◆ in_cleanup

bool MHD_Connection::in_cleanup

Connection is in the cleanup DL-linked list.

Definition at line 1553 of file internal.h.

Referenced by cleanup_connection().

◆ in_idle

bool MHD_Connection::in_idle

Are we currently inside the "idle" handler (to avoid recursively invoking it).

Definition at line 1548 of file internal.h.

Referenced by cleanup_connection(), MHD_connection_handle_idle(), and MHD_queue_response().

◆ is_nonip

enum MHD_tristate MHD_Connection::is_nonip

true if socket_fd is not TCP/IP (a UNIX domain socket, a pipe), false (TCP/IP) otherwise.

Definition at line 1489 of file internal.h.

Referenced by MHD_connection_set_cork_state_(), MHD_connection_set_nodelay_state_(), new_connection_prepare_(), post_send_setopt(), pre_send_setopt(), and zero_send_().

◆ keepalive

enum MHD_ConnKeepAlive MHD_Connection::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 1396 of file internal.h.

Referenced by build_header_response(), connection_reset(), keepalive_possible(), MHD_connection_handle_idle(), MHD_connection_handle_write(), MHD_connection_set_initial_state_(), parse_connection_headers(), setup_reply_properties(), and transmit_error_response_len().

◆ last_activity

uint64_t MHD_Connection::last_activity

Last time this connection had any activity (reading or writing).

Definition at line 1469 of file internal.h.

Referenced by connection_check_timedout(), MHD_get_timeout64(), MHD_set_connection_option(), MHD_update_last_activity_(), new_connection_prepare_(), and resume_suspended_connections().

◆ next

struct MHD_Connection* MHD_Connection::next

Next pointer for the DLL describing our IO state.

Definition at line 1336 of file internal.h.

◆ nextX

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

◆ pool

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

Referenced by connection_maximize_write_buffer(), connection_reset(), connection_shrink_read_buffer(), MHD_cleanup_connections(), MHD_connection_alloc_memory_(), MHD_connection_close_(), MHD_connection_handle_read(), MHD_connection_set_initial_state_(), new_connection_process_(), transmit_error_response_len(), try_grow_read_buffer(), and try_ready_chunked_body().

◆ prev

struct MHD_Connection* MHD_Connection::prev

Previous pointer for the DLL describing our IO state.

Definition at line 1341 of file internal.h.

Referenced by close_all_connections(), internal_get_fdset2(), internal_run_from_select(), and resume_suspended_connections().

◆ prevX

struct MHD_Connection* MHD_Connection::prevX

Previous pointer for the XDLL organizing connections by timeout.

Definition at line 1355 of file internal.h.

Referenced by MHD_get_timeout64().

◆ read_buffer

◆ read_buffer_offset

◆ read_buffer_size

◆ read_closed

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

Referenced by keepalive_possible(), MHD_connection_handle_idle(), and MHD_connection_handle_read().

◆ recv_cls

ReceiveCallback MHD_Connection::recv_cls

Function used for reading HTTP request stream.

Definition at line 1575 of file internal.h.

Referenced by MHD_connection_handle_read(), MHD_set_http_callbacks_(), and MHD_set_https_callbacks().

◆ resuming

volatile bool MHD_Connection::resuming

◆ rp

◆ rq

◆ sk_corked

enum MHD_tristate MHD_Connection::sk_corked

Tracks TCP_CORK / TCP_NOPUSH of the connection socket.

Definition at line 1504 of file internal.h.

Referenced by MHD_connection_set_cork_state_(), new_connection_prepare_(), post_send_setopt(), pre_send_setopt(), and zero_send_().

◆ sk_nodelay

enum MHD_tristate MHD_Connection::sk_nodelay

Tracks TCP_NODELAY state of the connection socket.

Definition at line 1509 of file internal.h.

Referenced by MHD_connection_set_nodelay_state_(), MHD_run_tls_handshake_(), new_connection_prepare_(), post_send_setopt(), pre_send_setopt(), and zero_send_().

◆ sk_nonblck

bool MHD_Connection::sk_nonblck

true if socket_fd is non-blocking, false otherwise.

Definition at line 1494 of file internal.h.

Referenced by call_handlers(), internal_run_from_select(), MHD_connection_handle_read(), MHD_send_hdr_and_body_(), new_connection_prepare_(), and send_iov_emu().

◆ sk_spipe_suppress

bool MHD_Connection::sk_spipe_suppress

true if connection socket has set SIGPIPE suppression

Definition at line 1499 of file internal.h.

Referenced by MHD_queue_response(), MHD_send_hdr_and_body_(), MHD_send_iovec_(), and new_connection_prepare_().

◆ socket_context

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

Referenced by MHD_cleanup_connections(), MHD_get_connection_info(), and new_connection_process_().

◆ socket_fd

◆ state

◆ stop_with_error

bool MHD_Connection::stop_with_error

Some error happens during processing the connection therefore this connection must be closed. The error may come from the client side (like wrong request format), from the application side (like data callback returned error), or from the OS side (like out-of-memory).

Definition at line 1526 of file internal.h.

Referenced by connection_close_error(), connection_reset(), get_req_headers(), keepalive_possible(), and transmit_error_response_len().

◆ suspended

◆ write_buffer

◆ write_buffer_append_offset

◆ write_buffer_send_offset

◆ write_buffer_size


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