GNU libmicrohttpd  0.9.72
mhd_send.h File Reference

Declarations of send() wrappers. More...

#include "platform.h"
#include "internal.h"
#include <errno.h>
#include "mhd_sockets.h"
#include "connection.h"
Include dependency graph for mhd_send.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 

Detailed Description

Declarations of send() wrappers.

Author
ng0
Karlson2k (Evgeny Grin)

Definition in file mhd_send.h.

Function Documentation

◆ MHD_send_data_()

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.

Parameters
connectionthe MHD_Connection structure
buffercontent of the buffer to send
buffer_sizethe size of the buffer (in bytes)
push_dataset 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).
Returns
sum of the number of bytes sent from both buffers or error code (negative)

Definition at line 662 of file mhd_send.c.

References MHD_Connection::daemon, MHD_CONNECTION_CLOSED, MHD_EPOLL_STATE_WRITE_READY, MHD_ERR_AGAIN_, MHD_ERR_CONNRESET_, MHD_ERR_NOMEM_, MHD_ERR_NOTCONN_, MHD_INVALID_SOCKET, MHD_SCKT_ECONNRESET_, MHD_SCKT_ERR_IS_, MHD_SCKT_ERR_IS_EAGAIN_, MHD_SCKT_ERR_IS_EINTR_, MHD_SCKT_ERR_IS_LOW_RESOURCES_, 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(), and MHD_send_hdr_and_body_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MHD_send_hdr_and_body_()

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.

Parameters
connectionthe MHD_Connection structure
headercontent of header to send
header_sizethe size of the header (in bytes)
never_push_hdrset to true to disable internal algorithm that can push automatically header data alone to the network
bodycontent of the body to send (optional, may be NULL)
body_sizethe size of the body (in bytes)
complete_responseset to true if complete response is provided by header and body, set to false if additional body data will be sent later
Returns
sum of the number of bytes sent from both buffers or error code (negative)

Definition at line 789 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_CONNRESET_, MHD_ERR_NOMEM_, MHD_ERR_NOTCONN_, MHD_INVALID_SOCKET, MHD_SCKT_ECONNRESET_, MHD_SCKT_ERR_IS_, MHD_SCKT_ERR_IS_EAGAIN_, MHD_SCKT_ERR_IS_EINTR_, MHD_SCKT_ERR_IS_LOW_RESOURCES_, 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().

Here is the call graph for this function:
Here is the caller graph for this function: