GNU libmicrohttpd  0.9.29
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
connection.h File Reference

Methods for managing connections. More...

#include "internal.h"
Include dependency graph for connection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void MHD_set_http_callbacks_ (struct MHD_Connection *connection)
 
int MHD_connection_handle_read (struct MHD_Connection *connection)
 
int MHD_connection_handle_write (struct MHD_Connection *connection)
 
int MHD_connection_handle_idle (struct MHD_Connection *connection)
 
void MHD_connection_close (struct MHD_Connection *connection, enum MHD_RequestTerminationCode termination_code)
 

Detailed Description

Methods for managing connections.

Author
Daniel Pittman
Christian Grothoff

Definition in file connection.h.

Function Documentation

int MHD_connection_handle_idle ( struct MHD_Connection connection)

This function was created to handle per-connection processing that has to happen even if the socket cannot be read or written to. All implementations (multithreaded, external select, internal select) call this function.

Parameters
connectionconnection to handle
Returns
MHD_YES if we should continue to process the connection (not dead yet), MHD_NO if it died

This function was created to handle per-connection processing that has to happen even if the socket cannot be read or written to.

Parameters
connectionconnection to handle
Returns
MHD_YES if we should continue to process the connection (not dead yet), MHD_NO if it died

Definition at line 2288 of file connection.c.

References build_header_response(), call_connection_handler(), cleanup_connection(), MHD_Connection::client_aware, MHD_Connection::client_context, CONNECTION_CLOSE_ERROR, MHD_Connection::connection_timeout, MHD_Connection::continue_message_write_offset, MHD_Response::crc, MHD_Connection::daemon, EDLL_insert, MHD_Connection::event_loop_info, EXTRA_CHECK, get_next_header_line(), MHD_Connection::have_chunked_upload, MHD_Connection::headers_received, MHD_Connection::headers_received_tail, HTTP_100_CONTINUE, MHD_Connection::in_idle, keepalive_possible(), MHD_Connection::last_activity, MHD_Connection::method, MHD_CONNECTION_BODY_RECEIVED, MHD_CONNECTION_BODY_SENT, MHD_CONNECTION_CHUNKED_BODY_READY, MHD_CONNECTION_CHUNKED_BODY_UNREADY, MHD_connection_close(), MHD_CONNECTION_CLOSED, MHD_CONNECTION_CONTINUE_SENDING, MHD_CONNECTION_CONTINUE_SENT, MHD_CONNECTION_FOOTER_PART_RECEIVED, MHD_CONNECTION_FOOTERS_RECEIVED, MHD_CONNECTION_FOOTERS_SENDING, MHD_CONNECTION_FOOTERS_SENT, MHD_CONNECTION_HEADER_PART_RECEIVED, MHD_CONNECTION_HEADERS_PROCESSED, MHD_CONNECTION_HEADERS_RECEIVED, MHD_CONNECTION_HEADERS_SENDING, MHD_CONNECTION_HEADERS_SENT, MHD_CONNECTION_INIT, MHD_CONNECTION_NORMAL_BODY_READY, MHD_CONNECTION_NORMAL_BODY_UNREADY, MHD_connection_update_event_loop_info(), MHD_CONNECTION_URL_RECEIVED, MHD_destroy_response(), MHD_EPOLL_STATE_IN_EREADY_EDLL, MHD_EPOLL_STATE_READ_READY, MHD_EPOLL_STATE_SUSPENDED, MHD_EPOLL_STATE_WRITE_READY, MHD_EVENT_LOOP_INFO_BLOCK, MHD_EVENT_LOOP_INFO_CLEANUP, MHD_EVENT_LOOP_INFO_READ, MHD_EVENT_LOOP_INFO_WRITE, MHD_FOOTER_KIND, MHD_get_response_header(), MHD_HEADER_KIND, MHD_HTTP_BAD_REQUEST, MHD_HTTP_HEADER_CONNECTION, MHD_HTTP_METHOD_POST, MHD_HTTP_METHOD_PUT, MHD_lookup_connection_value(), MHD_monotonic_time(), MHD_NO, MHD_pool_destroy(), MHD_pool_reset(), MHD_REQUEST_TERMINATED_COMPLETED_OK, MHD_REQUEST_TERMINATED_TIMEOUT_REACHED, MHD_SIZE_UNKNOWN, MHD_str_equal_caseless_, MHD_YES, MHD_Response::mutex, need_100_continue(), MHD_Daemon::notify_completed, MHD_Daemon::notify_completed_cls, NULL, parse_connection_headers(), parse_initial_message_line(), MHD_Connection::pool, process_broken_line(), process_header_line(), process_request_body(), MHD_Connection::read_buffer, MHD_Connection::read_buffer_offset, MHD_Connection::read_buffer_size, MHD_Connection::read_closed, MHD_Connection::remaining_upload_size, REQUEST_MALFORMED, MHD_Connection::response, MHD_Connection::response_write_position, MHD_Connection::responseCode, MHD_Connection::socket_fd, MHD_Connection::state, MHD_Response::total_size, transmit_error_response(), try_ready_chunked_body(), try_ready_normal_body(), MHD_Connection::url, MHD_Connection::version, MHD_Connection::write_buffer, MHD_Connection::write_buffer_append_offset, MHD_Connection::write_buffer_send_offset, and MHD_Connection::write_buffer_size.

Referenced by MHD_queue_response(), MHD_set_http_callbacks_(), and MHD_tls_connection_handle_idle().

Here is the call graph for this function:

Here is the caller graph for this function:

int MHD_connection_handle_read ( struct MHD_Connection connection)

This function handles a particular connection when it has been determined that there is data to be read off a socket. All implementations (multithreaded, external select, internal select) call this function to handle reads.

Parameters
connectionconnection to handle
Returns
always MHD_YES (we should continue to process the connection)

This function handles a particular connection when it has been determined that there is data to be read off a socket.

Parameters
connectionconnection to handle
Returns
always MHD_YES (we should continue to process the connection)

Definition at line 2020 of file connection.c.

References MHD_Connection::daemon, do_read(), MHD_CONNECTION_BODY_RECEIVED, MHD_connection_close(), MHD_CONNECTION_CLOSED, MHD_CONNECTION_CONTINUE_SENDING, MHD_CONNECTION_CONTINUE_SENT, MHD_CONNECTION_FOOTER_PART_RECEIVED, MHD_CONNECTION_HEADER_PART_RECEIVED, MHD_CONNECTION_HEADERS_PROCESSED, MHD_CONNECTION_HEADERS_RECEIVED, MHD_CONNECTION_INIT, MHD_CONNECTION_URL_RECEIVED, MHD_NO, MHD_pool_reallocate(), MHD_REQUEST_TERMINATED_READ_ERROR, MHD_YES, MHD_Connection::pool, MHD_Daemon::pool_increment, MHD_Connection::read_buffer, MHD_Connection::read_buffer_offset, MHD_Connection::read_buffer_size, MHD_Connection::read_closed, MHD_Connection::state, try_grow_read_buffer(), and update_last_activity().

Referenced by MHD_set_http_callbacks_(), and MHD_tls_connection_handle_read().

Here is the call graph for this function:

Here is the caller graph for this function:

int MHD_connection_handle_write ( struct MHD_Connection connection)

This function was created to handle writes to sockets when it has been determined that the socket can be written to. All implementations (multithreaded, external select, internal select) call this function

Parameters
connectionconnection to handle
Returns
always MHD_YES (we should continue to process the connection)

This function was created to handle writes to sockets when it has been determined that the socket can be written to.

Parameters
connectionconnection to handle
Returns
always MHD_YES (we should continue to process the connection)

Definition at line 2083 of file connection.c.

References check_write_done(), CONNECTION_CLOSE_ERROR, MHD_Connection::continue_message_write_offset, MHD_Response::crc, MHD_Connection::daemon, MHD_Response::data, MHD_Response::data_size, MHD_Response::data_start, do_write(), EWOULDBLOCK, EXTRA_CHECK, HTTP_100_CONTINUE, MHD_CONNECTION_BODY_RECEIVED, MHD_CONNECTION_BODY_SENT, MHD_CONNECTION_CHUNKED_BODY_READY, MHD_CONNECTION_CHUNKED_BODY_UNREADY, MHD_CONNECTION_CLOSED, MHD_CONNECTION_CONTINUE_SENDING, MHD_CONNECTION_CONTINUE_SENT, MHD_CONNECTION_FOOTER_PART_RECEIVED, MHD_CONNECTION_FOOTERS_RECEIVED, MHD_CONNECTION_FOOTERS_SENDING, MHD_CONNECTION_FOOTERS_SENT, MHD_CONNECTION_HEADER_PART_RECEIVED, MHD_CONNECTION_HEADERS_PROCESSED, MHD_CONNECTION_HEADERS_RECEIVED, MHD_CONNECTION_HEADERS_SENDING, MHD_CONNECTION_HEADERS_SENT, MHD_CONNECTION_INIT, MHD_CONNECTION_NORMAL_BODY_READY, MHD_CONNECTION_NORMAL_BODY_UNREADY, MHD_CONNECTION_URL_RECEIVED, MHD_socket_errno_, MHD_socket_last_strerr_, MHD_TLS_CONNECTION_INIT, MHD_YES, MHD_Response::mutex, NULL, MHD_Connection::response, MHD_Connection::response_write_position, MHD_Connection::send_cls, MHD_Connection::state, MHD_Response::total_size, try_ready_normal_body(), and update_last_activity().

Referenced by MHD_set_http_callbacks_(), and MHD_tls_connection_handle_write().

Here is the call graph for this function:

Here is the caller graph for this function:

void MHD_set_http_callbacks_ ( struct MHD_Connection connection)

Set callbacks for this connection to those for HTTP.

Parameters
connectionconnection to initialize

Definition at line 2786 of file connection.c.

References MHD_Connection::idle_handler, MHD_connection_handle_idle(), MHD_connection_handle_read(), MHD_connection_handle_write(), MHD_Connection::read_handler, and MHD_Connection::write_handler.

Referenced by internal_add_connection().

Here is the call graph for this function:

Here is the caller graph for this function: