http_response.c File Reference

HTTP response module implementation file. More...

#include "http_response.h"
#include "definitions.h"
#include "memory.h"
#include "log_util.h"
Include dependency graph for http_response.c:

Go to the source code of this file.

Functions

E_MCL_ERROR_CODE http_response_initialize (string_array_t *header, mcl_uint8_t *payload, mcl_size_t payload_size, E_MCL_HTTP_RESULT_CODE result_code, http_response_t **http_response)
 HTTP Response Module Initialize function. More...
 
E_MCL_ERROR_CODE http_response_get_header (http_response_t *http_response, char *header_name, string_t **header_value)
 Get the value of a specified HTTP Header. More...
 
mcl_uint8_thttp_response_get_payload (http_response_t *http_response)
 Get the payload section of the HTTP Response. More...
 
E_MCL_HTTP_RESULT_CODE http_response_get_result_code (http_response_t *http_response)
 Get the result code of the HTTTP Response. More...
 
void http_response_destroy (http_response_t **http_response)
 To destroy the HTTP Response Handler. More...
 

Detailed Description

HTTP response module implementation file.


Date
Jul 19, 2016

Definition in file http_response.c.

Function Documentation

void http_response_destroy ( http_response_t **  http_response)

To destroy the HTTP Response Handler.

Will release the resources of HTTP Response Handler. After destroy operation, handler shouldn't be used.

Parameters
[in]http_responseHTTP Response Handle.

Definition at line 99 of file http_response.c.

References DEBUG_ENTRY, DEBUG_LEAVE, MCL_DEBUG, MCL_FREE, MCL_NULL, and string_array_destroy().

Referenced by _exchange_evaluate_response(), http_processor_get_access_token(), and http_processor_register().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE http_response_get_header ( http_response_t http_response,
char *  header_name,
string_t **  header_value 
)

Get 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_valueValur of the header will be stored in header_value.

Definition at line 38 of file http_response.c.

References ASSERT_CODE, ASSERT_CODE_MESSAGE, string_t::buffer, mcl_list_t::count, mcl_list_node_t::data, DEBUG_ENTRY, DEBUG_LEAVE, mcl_list_t::head, http_response_t::header, string_array_t::index, list_destroy_with_content(), MCL_DEBUG, MCL_FAIL, MCL_NULL, MCL_OK, MCL_TRUE, mcl_list_node_t::next, string_array_get(), string_destroy(), string_initialize(), string_split(), and string_util_find_case_insensitive().

Referenced by _process_registration_response_rsa_3072(), and http_processor_get_access_token().

Here is the call graph for this function:

Here is the caller graph for this function:

mcl_uint8_t* http_response_get_payload ( http_response_t http_response)

Get the payload section of the HTTP Response.

Parameters
[in]http_responseHTTP Response handle to be used.
Returns
Returns the pointer to the payload of http_response.

Definition at line 83 of file http_response.c.

References DEBUG_ENTRY, DEBUG_LEAVE, and http_response_t::payload.

Referenced by _process_registration_response_rsa_3072(), _process_registration_response_shared_secret(), and http_processor_get_access_token().

Here is the caller graph for this function:

E_MCL_HTTP_RESULT_CODE http_response_get_result_code ( http_response_t http_response)

Get the result code of the HTTTP Response.

Parameters
[in]http_responseHTTP Response handle to be used.
Returns
HTTP Result Code.

Definition at line 91 of file http_response.c.

References DEBUG_ENTRY, DEBUG_LEAVE, and http_response_t::result_code.

E_MCL_ERROR_CODE http_response_initialize ( string_array_t header,
mcl_uint8_t payload,
mcl_size_t  payload_size,
E_MCL_HTTP_RESULT_CODE  result_code,
http_response_t **  http_response 
)

HTTP Response Module Initialize function.

Create and initializes an http_response_t object and sets its result code if not received.

Parameters
[in]headerString array for the received HTTP Header.
[in]payloadThe received HTTP Payload.
[in]payload_sizeSize of payload.
[in]result_codeThe received status code. If this is 0, http_response_initialize will extract the result code from the message itself.
[out]http_responseHandle of the initialized http_response_t object.
Returns

Definition at line 19 of file http_response.c.

References ASSERT_CODE_MESSAGE, DEBUG_ENTRY, DEBUG_LEAVE, MCL_NEW, MCL_NULL, MCL_OK, and MCL_OUT_OF_MEMORY.

Referenced by http_client_send().

Here is the caller graph for this function: