GNU libmicrohttpd 0.9.77
Loading...
Searching...
No Matches
action_from_response.c File Reference

implementation of MHD_action_from_response() More...

#include "internal.h"
#include "connection_call_handlers.h"
Include dependency graph for action_from_response.c:

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_ActionMHD_action_from_response (struct MHD_Response *response, enum MHD_Bool destroy_after_use)
 

Detailed Description

implementation of MHD_action_from_response()

Author
Christian Grothoff

Definition in file action_from_response.c.

Function Documentation

◆ MHD_action_from_response()

_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).

Parameters
responseresponse to convert, not NULL
destroy_after_useshould the response object be consumed?
Returns
corresponding action, never returns NULL

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().

Here is the call graph for this function:

◆ response_action()

static enum MHD_StatusCode response_action ( void *  cls,
struct MHD_Request request 
)
static

A response was given as the desired action for a request. Queue the response for the request.

Parameters
clsthe struct MHD_Response
requestthe request we are processing
Returns
#MHD_SC_OK on success

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().

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