GNU libmicrohttpd 0.9.77
|
Declarations of send() wrappers. More...
#include "platform.h"
#include "internal.h"
#include <errno.h>
#include "mhd_sockets.h"
#include "connection.h"
Go to the source code of this file.
Functions | |
void | MHD_send_init_static_vars_ (void) |
ssize_t | MHD_send_data_ (struct MHD_Connection *connection, const char *buffer, size_t buffer_size, bool push_data) |
ssize_t | MHD_send_hdr_and_body_ (struct MHD_Connection *connection, const char *header, size_t header_size, bool never_push_hdr, const char *body, size_t body_size, bool complete_response) |
bool | MHD_connection_set_nodelay_state_ (struct MHD_Connection *connection, bool nodelay_state) |
bool | MHD_connection_set_cork_state_ (struct MHD_Connection *connection, bool cork_state) |
ssize_t | MHD_send_iovec_ (struct MHD_Connection *connection, struct MHD_iovec_track_ *const r_iov, bool push_data) |
Declarations of send() wrappers.
Definition in file mhd_send.h.
bool MHD_connection_set_cork_state_ | ( | struct MHD_Connection * | connection, |
bool | cork_state | ||
) |
Set required cork state for connection socket
The function automatically updates sk_corked state.
connection | the connection to manipulate |
cork_state | the requested new state of socket |
Definition at line 240 of file mhd_send.c.
References _, _MHD_UNKNOWN, _MHD_YES, MHD_Connection::daemon, MHD_Connection::is_nonip, MHD_SCKT_EINVAL_, MHD_SCKT_ENOPROTOOPT_, MHD_SCKT_ENOTSOCK_, MHD_SCKT_ERR_IS_, MHD_socket_get_error_, MHD_socket_strerr_, MHD_Connection::sk_corked, and MHD_Connection::socket_fd.
Referenced by post_send_setopt(), and pre_send_setopt().
bool MHD_connection_set_nodelay_state_ | ( | struct MHD_Connection * | connection, |
bool | nodelay_state | ||
) |
Set required TCP_NODELAY state for connection socket
The function automatically updates sk_nodelay state.
connection | the connection to manipulate |
nodelay_state | the requested new state of socket |
Definition at line 170 of file mhd_send.c.
References _, _MHD_UNKNOWN, _MHD_YES, MHD_Connection::daemon, MHD_Connection::is_nonip, MHD_SCKT_EINVAL_, MHD_SCKT_ENOPROTOOPT_, MHD_SCKT_ENOTSOCK_, MHD_SCKT_ERR_IS_, MHD_socket_get_error_, MHD_socket_strerr_, MHD_Connection::sk_nodelay, and MHD_Connection::socket_fd.
Referenced by MHD_run_tls_handshake_(), post_send_setopt(), and pre_send_setopt().
ssize_t MHD_send_data_ | ( | struct MHD_Connection * | connection, |
const char * | buffer, | ||
size_t | buffer_size, | ||
bool | push_data | ||
) |
Send buffer to the client, push data from network buffer if requested and full buffer is sent.
connection | the MHD_Connection structure |
buffer | content of the buffer to send |
buffer_size | the size of the buffer (in bytes) |
push_data | set to true to force push the data to the network from system buffers (usually set for the last piece of data), set to false to prefer holding incomplete network packets (more data will be send for the same reply). |
Definition at line 749 of file mhd_send.c.
References MHD_Connection::daemon, MHD_CONNECTION_CLOSED, MHD_EPOLL_STATE_WRITE_READY, MHD_ERR_AGAIN_, MHD_ERR_BADF_, MHD_ERR_CONNRESET_, MHD_ERR_INVAL_, MHD_ERR_NOMEM_, MHD_ERR_NOTCONN_, MHD_ERR_OPNOTSUPP_, MHD_ERR_PIPE_, MHD_ERR_TLS_, MHD_INVALID_SOCKET, MHD_SCKT_EBADF_, MHD_SCKT_EINVAL_, MHD_SCKT_ENOTCONN_, MHD_SCKT_EOPNOTSUPP_, MHD_SCKT_EPIPE_, MHD_SCKT_ERR_IS_, MHD_SCKT_ERR_IS_EAGAIN_, MHD_SCKT_ERR_IS_EINTR_, MHD_SCKT_ERR_IS_LOW_RESOURCES_, MHD_SCKT_ERR_IS_REMOTE_DISCNN_, MHD_SCKT_SEND_MAX_SIZE_, MHD_send4_, MHD_socket_get_error_, MHD_USE_TLS, MHD_Daemon::options, post_send_setopt(), pre_send_setopt(), MHD_Connection::socket_fd, SSIZE_MAX, and MHD_Connection::state.
Referenced by MHD_connection_handle_write(), MHD_send_hdr_and_body_(), and send_iov_emu().
ssize_t MHD_send_hdr_and_body_ | ( | struct MHD_Connection * | connection, |
const char * | header, | ||
size_t | header_size, | ||
bool | never_push_hdr, | ||
const char * | body, | ||
size_t | body_size, | ||
bool | complete_response | ||
) |
Send reply header with optional reply body.
connection | the MHD_Connection structure |
header | content of header to send |
header_size | the size of the header (in bytes) |
never_push_hdr | set to true to disable internal algorithm that can push automatically header data alone to the network |
body | content of the body to send (optional, may be NULL) |
body_size | the size of the body (in bytes) |
complete_response | set to true if complete response is provided by header and body, set to false if additional body data will be sent later |
Definition at line 901 of file mhd_send.c.
References _MHD_SEND_VEC_MAX, MHD_Connection::daemon, mhd_assert, MHD_CONNECTION_CLOSED, MHD_EPOLL_STATE_WRITE_READY, MHD_ERR_AGAIN_, MHD_ERR_BADF_, MHD_ERR_CONNRESET_, MHD_ERR_INVAL_, MHD_ERR_NOMEM_, MHD_ERR_NOTCONN_, MHD_ERR_OPNOTSUPP_, MHD_ERR_PIPE_, MHD_INVALID_SOCKET, MHD_SCKT_EBADF_, MHD_SCKT_EINVAL_, MHD_SCKT_ENOTCONN_, MHD_SCKT_EOPNOTSUPP_, MHD_SCKT_EPIPE_, MHD_SCKT_ERR_IS_, MHD_SCKT_ERR_IS_EAGAIN_, MHD_SCKT_ERR_IS_EINTR_, MHD_SCKT_ERR_IS_LOW_RESOURCES_, MHD_SCKT_ERR_IS_REMOTE_DISCNN_, MHD_send_data_(), MHD_socket_get_error_, MHD_USE_TLS, MSG_NOSIGNAL_OR_ZERO, NULL, MHD_Daemon::options, post_send_setopt(), pre_send_setopt(), MHD_Daemon::sigpipe_blocked, MHD_Connection::sk_nonblck, MHD_Connection::sk_spipe_suppress, MHD_Connection::socket_fd, SSIZE_MAX, MHD_Connection::state, and UINT_MAX.
Referenced by MHD_connection_handle_write().
void MHD_send_init_static_vars_ | ( | void | ) |
Initialises static variables
Definition at line 153 of file mhd_send.c.
Referenced by MHD_init().
ssize_t MHD_send_iovec_ | ( | struct MHD_Connection * | connection, |
struct MHD_iovec_track_ *const | r_iov, | ||
bool | push_data | ||
) |
Function for sending responses backed by a an array of memory buffers.
connection | the MHD connection structure |
r_iov | the pointer to iov response structure with tracking |
push_data | set to true to force push the data to the network from system buffers (usually set for the last piece of data), set to false to prefer holding incomplete network packets (more data will be send for the same reply). |
Definition at line 1614 of file mhd_send.c.
References MHD_iovec_track_::cnt, MHD_Connection::daemon, MHD_Response::data_iov, MHD_iovec_track_::iov, mhd_assert, MHD_USE_TLS, NULL, MHD_Daemon::options, MHD_Connection::resp_iov, MHD_Connection::response, send_iov_emu(), MHD_iovec_track_::sent, MHD_Daemon::sigpipe_blocked, and MHD_Connection::sk_spipe_suppress.
Referenced by MHD_connection_handle_write().