GNU libmicrohttpd 0.9.77
|
implementation of MHD_action_from_response() More...
Go to the source code of this file.
Functions | |
static enum MHD_StatusCode | response_action (void *cls, struct MHD_Request *request) |
_MHD_EXTERN const struct MHD_Action * | MHD_action_from_response (struct MHD_Response *response, enum MHD_Bool destroy_after_use) |
implementation of MHD_action_from_response()
Definition in file action_from_response.c.
_MHD_EXTERN const struct MHD_Action * MHD_action_from_response | ( | struct MHD_Response * | response, |
enum MHD_Bool | destroy_after_use | ||
) |
Converts a response to an action. If consume is set, the reference to the response is consumed by the conversion. If consume is MHD_NO, then the response can be converted to actions in the future. However, the response is frozen by this step and must no longer be modified (i.e. by setting headers).
response | response to convert, not NULL |
destroy_after_use | should the response object be consumed? |
Implementation note: internally, this is largely just a cast (and possibly an RC increment operation), as a response is an action. As no memory is allocated, this operation cannot fail.
Definition at line 117 of file action_from_response.c.
References MHD_Action::action, MHD_Response::action, MHD_Action::action_cls, MHD_mutex_lock_chk_, MHD_mutex_unlock_chk_, MHD_Response::mutex, MHD_Response::reference_count, and response_action().
|
static |
A response was given as the desired action for a request. Queue the response for the request.
cls | the struct MHD_Response |
request | the request we are processing |
Definition at line 38 of file action_from_response.c.
References _, MHD_Request::connection, MHD_Request::daemon, MHD_Daemon::disallow_upgrade, MHD_Response::fd, MHD_Request::in_idle, MHD_Request::method, MHD_HTTP_NO_CONTENT, MHD_HTTP_NOT_MODIFIED, MHD_HTTP_OK, MHD_REQUEST_FOOTERS_RECEIVED, MHD_request_handle_idle_(), MHD_REQUEST_HEADERS_PROCESSED, NULL, MHD_Connection::read_closed, MHD_Request::response, MHD_Request::response_write_position, MHD_Daemon::shutdown, MHD_Request::state, MHD_Response::status_code, and MHD_Response::total_size.
Referenced by MHD_action_from_response().