http_response.c File Reference

HTTP response module implementation file. More...

#include "http_response.h"
#include "string_util.h"
#include "mcl_core/mcl_assert.h"
#include "mcl_core/mcl_memory.h"
#include <stdlib.h>
Include dependency graph for http_response.c:

Go to the source code of this file.

Functions

static void _free_string (char **header)
 
mcl_error_t mcl_http_response_initialize (mcl_list_t *header, mcl_uint8_t *payload, mcl_size_t payload_size, E_MCL_HTTP_STATUS_CODE status_code, mcl_http_response_t **http_response)
 
mcl_error_t mcl_http_response_get_header (mcl_http_response_t *http_response, const char *header_name, char **header_value)
 
mcl_error_t mcl_http_response_get_status (mcl_http_response_t *http_response)
 
void mcl_http_response_destroy (mcl_http_response_t **http_response)
 

Detailed Description

HTTP response module implementation file.

Definition in file http_response.c.

Function Documentation

static void _free_string ( char **  header)
static

Definition at line 195 of file http_response.c.

References MCL_FREE.

Referenced by mcl_http_response_destroy().

Here is the caller graph for this function:

void mcl_http_response_destroy ( mcl_http_response_t **  http_response)

This function destroys the HTTP response handle.

Parameters
[in]http_responseHTTP response handle.

Definition at line 174 of file http_response.c.

References _free_string(), MCL_DEBUG, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, mcl_list_destroy_with_content(), and MCL_NULL.

Referenced by core_processor_get_access_token(), and core_processor_register().

Here is the call graph for this function:

Here is the caller graph for this function:

mcl_error_t mcl_http_response_get_header ( mcl_http_response_t http_response,
const char *  header_name,
char **  header_value 
)

This function gets the value of a specified HTTP header.

Parameters
[in]http_responseHTTP response handle to be used.
[in]header_nameName of the header whose value is requested.
[out]header_valueValue of the header will be stored in header_value.
Returns

Definition at line 44 of file http_response.c.

References mcl_list_node_t::data, mcl_http_response_t::header, MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, MCL_CALLOC, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FAIL, MCL_FUNCTION_LEAVE_LABEL, mcl_list_next(), mcl_list_reset(), MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, MCL_TRUE, string_util_find(), string_util_find_case_insensitive(), string_util_strlen(), and string_util_strncpy().

Referenced by core_processor_get_access_token().

Here is the call graph for this function:

Here is the caller graph for this function:

mcl_error_t mcl_http_response_initialize ( mcl_list_t header,
mcl_uint8_t payload,
mcl_size_t  payload_size,
E_MCL_HTTP_STATUS_CODE  status_code,
mcl_http_response_t **  http_response 
)

This function initializes an HTTP response message.

Parameters
[in]headerList of received HTTP headers.
[in]payloadThe received HTTP payload.
[in]payload_sizeSize of payload.
[in]status_codeThe received status code.
[out]http_responseHandle of the initialized mcl_http_response_t object.
Returns

Definition at line 17 of file http_response.c.

References MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_NEW, MCL_NULL, MCL_OK, and MCL_OUT_OF_MEMORY.

Referenced by get_response(), and mcl_http_client_send().

Here is the caller graph for this function: