21 DEBUG_ENTRY(
"string_array_t *header = <%p>, mcl_uint8_t *payload = <%p>, mcl_size_t payload_size = <%u>, E_MCL_HTTP_RESULT_CODE result_code = <%d>, http_response_t **http_response = <%p>",
22 header, payload, payload_size, result_code, http_response)
29 (*http_response)->header = header;
30 (*http_response)->payload = payload;
31 (*http_response)->payload_size = payload_size;
32 (*http_response)->result_code = result_code;
40 DEBUG_ENTRY(
"http_response_t *http_response = <%p>, char *header_name = <%s>", http_response, header_name)
46 for (index = 0; index < header_count; index++)
64 if (2 != tokens->
count)
66 MCL_DEBUG(
"Number of colons that header contains is not 1.");
85 DEBUG_ENTRY(
"http_response_t *http_response = <%p>", http_response)
93 DEBUG_ENTRY(
"http_response_t *http_response = <%p>", http_response)
101 DEBUG_ENTRY(
"http_response_t **http_response = <%p>", http_response)
107 MCL_FREE((*http_response)->payload);
110 MCL_DEBUG(
"Http response is successfully destroyed.");
114 MCL_DEBUG(
"Http response is already NULL.");
void string_destroy(string_t **string)
Destroys the allocated resources of the string.
Memory module header file.
void http_response_destroy(http_response_t **http_response)
To destroy the HTTP Response Handler.
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.
mcl_size_t index
Item index.
char * buffer
Buffer of string handle.
E_MCL_ERROR_CODE string_split(string_t *string, const char token, list_t **string_list)
Splits the string with the given char and returns the result as an list_t of string_t's.
void string_array_destroy(string_array_t **array)
Destroys the string array handle.
string_array_t * header
Header of http response.
E_MCL_HTTP_RESULT_CODE result_code
Result code of http response.
string_t * string_array_get(string_array_t *array, mcl_size_t index)
To get the string_t string object at a specified index.
Log utility module header file.
mcl_bool_t string_util_find_case_insensitive(const char *source, const char *target, mcl_size_t *start_index)
Finds the first occurence of target in source and puts it's first index to start_index.
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
struct mcl_list_node_t * next
Next node in the list.
mcl_list_node_t * head
Head node of the list.
#define ASSERT_CODE_MESSAGE(condition, return_code,...)
Definitions module header file.
E_MCL_HTTP_RESULT_CODE http_response_get_result_code(http_response_t *http_response)
Get the result code of the HTTTP Response.
E_MCL_ERROR_CODE string_initialize(const string_t *other, string_t **string)
Initializes an string_t object with another one.
mcl_uint8_t * http_response_get_payload(http_response_t *http_response)
Get the payload section of the HTTP Response.
#define ASSERT_CODE(condition, return_code)
void list_destroy_with_content(list_t **list, list_item_destroy_callback callback)
To destroy the list and its items with a given callback function.
E_MCL_HTTP_RESULT_CODE
HTTP Result Codes.
mcl_size_t count
Node count of the list.
mcl_list_item_destroy_callback list_item_destroy_callback
void * data
Data of the node.
HTTP response module header file.
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.
mcl_uint8_t * payload
Payload of http response.