22 MCL_DEBUG_ENTRY(
"mcl_list_t *header = <%p>, mcl_uint8_t *payload = <%p>, mcl_size_t payload_size = <%u>, E_MCL_HTTP_STATUS_CODE status_code = <%d>, "\
23 "mcl_http_response_t **http_response = <%p>", header, payload, payload_size, status_code, http_response);
34 (*http_response)->header = header;
35 (*http_response)->payload = payload;
36 (*http_response)->payload_size = payload_size;
37 (*http_response)->status_code = status_code;
48 MCL_DEBUG_ENTRY(
"mcl_http_response_t *http_response = <%p>, char *header_name = <%s>, char **header_value = <%p>",
49 http_response, header_name, header_value);
69 header = (
char *) header_node->
data;
81 if (
' ' == header[index + 1])
86 *header_value =
MCL_CALLOC(header_length - index, 1);
89 value_length = header_length - index - 1;
93 (*header_value)[value_length] =
'\0';
109 MCL_DEBUG_ENTRY(
"mcl_http_response_t *http_response = <%p>", http_response);
165 MCL_INFO(
"Server responded with unexpected HTTP status code %d.", http_response->
status_code);
176 MCL_DEBUG_ENTRY(
"mcl_http_response_t **http_response = <%p>", http_response);
182 MCL_FREE((*http_response)->payload);
185 MCL_DEBUG(
"Http response is successfully destroyed.");
189 MCL_DEBUG(
"Http response is already NULL.");
#define MCL_FUNCTION_LEAVE_LABEL
mcl_list_t * header
Header of http response.
E_MCL_HTTP_STATUS_CODE status_code
Status code of http response.
Assert module header file.
void mcl_http_response_destroy(mcl_http_response_t **http_response)
If the response of server is HTTP 409.
#define MCL_CALLOC(count, bytes)
If the response of server is unexpected.
If the response of server is HTTP 412.
If the response of server is HTTP 429.
mcl_bool_t string_util_find(const char *source, const char *target, mcl_size_t *start_index)
mcl_error_t mcl_http_response_get_header(mcl_http_response_t *http_response, const char *header_name, char **header_value)
#define MCL_DEBUG_ENTRY(...)
void string_util_strncpy(char *destination, const char *source, mcl_size_t count)
void(* mcl_list_item_destroy_callback)(void **item)
mcl_bool_t string_util_find_case_insensitive(const char *source, const char *target, mcl_size_t *start_index)
If the response of server is HTTP 206.
String utility module header file.
static void _free_string(char **header)
MCL_CORE_EXPORT mcl_error_t mcl_list_next(mcl_list_t *list, mcl_list_node_t **node)
#define MCL_ASSERT_CODE_MESSAGE(condition, return_code,...)
If the response of server is HTTP 401.
If the response of server is HTTP 413.
If the response of server is HTTP 201.
MCL_CORE_EXPORT void mcl_list_destroy_with_content(mcl_list_t **list, mcl_list_item_destroy_callback callback)
If the response of server is HTTP 400.
#define MCL_ASSERT_NOT_NULL(argument, return_variable)
MCL_CORE_EXPORT void mcl_list_reset(mcl_list_t *list)
If the response of server is HTTP 403.
mcl_error_t mcl_http_response_get_status(mcl_http_response_t *http_response)
#define MCL_DEBUG_LEAVE(...)
void * data
Data of the node.
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_size_t string_util_strlen(const char *buffer)
HTTP response module header file.
If the response of server is HTTP 404.
Memory module interface header file.