GNU libmicrohttpd 1.0.0
|
Methods for managing response objects. More...
Go to the source code of this file.
Functions | |
void | MHD_increment_response_rc (struct MHD_Response *response) |
enum MHD_Result | MHD_response_execute_upgrade_ (struct MHD_Response *response, struct MHD_Connection *connection) |
struct MHD_HTTP_Res_Header * | MHD_get_response_element_n_ (struct MHD_Response *response, enum MHD_ValueKind kind, const char *key, size_t key_len) |
bool | MHD_add_response_entry_no_check_ (struct MHD_Response *response, enum MHD_ValueKind kind, const char *header, size_t header_len, const char *content, size_t content_len) |
bool | MHD_add_response_entry_no_alloc_ (struct MHD_Response *response, enum MHD_ValueKind kind, char *header, size_t header_len, char *content, size_t content_len) |
Methods for managing response objects.
Definition in file response.h.
bool MHD_add_response_entry_no_alloc_ | ( | struct MHD_Response * | response, |
enum MHD_ValueKind | kind, | ||
char * | header, | ||
size_t | header_len, | ||
char * | content, | ||
size_t | content_len ) |
Add preallocated strings a header or footer line to the response without checking.
Header/footer strings are not checked and assumed to be correct.
The string must not be statically allocated! The strings must be malloc()'ed and zero terminated. The strings will be free()'ed when the response is destroyed.
response | response to add a header to |
kind | header or footer |
header | the header string to add, must be malloc()'ed and zero-terminated |
header_len | the length of the header |
content | the value string to add, must be malloc()'ed and zero-terminated |
content_len | the length of the content |
Definition at line 167 of file response.c.
References _MHD_insert_header_last, MHD_HTTP_Res_Header::header, MHD_HTTP_Res_Header::header_size, MHD_HTTP_Res_Header::kind, mhd_assert, MHD_calloc_(), MHD_HTTP_OK, NULL, MHD_HTTP_Res_Header::value, and MHD_HTTP_Res_Header::value_size.
Referenced by MHD_add_response_entry_no_check_(), queue_auth_required_response3_inner(), and transmit_error_response_len().
bool MHD_add_response_entry_no_check_ | ( | struct MHD_Response * | response, |
enum MHD_ValueKind | kind, | ||
const char * | header, | ||
size_t | header_len, | ||
const char * | content, | ||
size_t | content_len ) |
Add a header or footer line to the response without checking.
It is assumed that parameters are correct.
response | response to add a header to |
kind | header or footer |
header | the header to add, does not need to be zero-terminated |
header_len | the length of the header |
content | value to add, does not need to be zero-terminated |
content_len | the length of the content |
Definition at line 207 of file response.c.
References MHD_HTTP_Res_Header::header, MHD_HTTP_Res_Header::kind, MHD_add_response_entry_no_alloc_(), mhd_assert, MHD_HTTP_OK, and NULL.
Referenced by add_response_entry_n().
void MHD_increment_response_rc | ( | struct MHD_Response * | response | ) |
Increments the reference counter for the response.
response | object to modify |
Definition at line 2335 of file response.c.
References MHD_mutex_lock_chk_, MHD_mutex_unlock_chk_, MHD_Response::mutex, and MHD_Response::reference_count.
Referenced by MHD_queue_response().
enum MHD_Result MHD_response_execute_upgrade_ | ( | struct MHD_Response * | response, |
struct MHD_Connection * | connection ) |
We are done sending the header of a given response to the client. Now it is time to perform the upgrade and hand over the connection to the application.
response | the response that was created for an upgrade |
connection | the specific connection we are upgrading |
Referenced by MHD_connection_handle_idle(), and MHD_request_handle_idle_().