Response data handling.
More...
#include "gsad_cmd.h"
#include <microhttpd.h>
#include <string.h>
◆ cmd_response_data_free()
Frees the memory of a cmd_response_data_t struct.
If content_disposition of data is not NULL the content_disposition is also being freed.
- Parameters
-
[in] | data | The cmd_response_data_t struct to free |
◆ cmd_response_data_get_content_disposition()
Get content disposition of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
- Returns
- Size of the response
◆ cmd_response_data_get_content_length()
Get response content length of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
- Returns
- Content length of the response
◆ cmd_response_data_get_content_type()
Get content type of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
- Returns
- The content type
◆ cmd_response_data_get_content_type_string()
Get a content type string if set.
- Parameters
-
[in] | data | Command response data struct |
- Returns
- Content type string if set
◆ cmd_response_data_get_status_code()
Get http status code of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
- Returns
- HTTP status code
◆ cmd_response_data_init()
Initializes a cmd_response_data_t struct.
- Parameters
-
[in] | data | The cmd_response_data_t struct to initialize |
◆ cmd_response_data_is_allow_caching()
Get allow_caching flag of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
- Returns
- The allow_caching flag
◆ cmd_response_data_new()
Allocates memory for a cmd_response_data_t sturct and initializes it.
- Returns
- Pointer to the newly allocated cmd_response_data_t struct
◆ cmd_response_data_set_allow_caching()
void cmd_response_data_set_allow_caching |
( |
cmd_response_data_t * |
data, |
|
|
gboolean |
allow_caching |
|
) |
| |
Set allow_caching flag of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
[in] | allow_caching | allow_caching flag to set |
◆ cmd_response_data_set_content_disposition()
void cmd_response_data_set_content_disposition |
( |
cmd_response_data_t * |
data, |
|
|
gchar * |
content_disposition |
|
) |
| |
Set content disposition of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
[in] | content_disposition | Content disposition |
◆ cmd_response_data_set_content_length()
Set response content length of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
[in] | content_length | Content length of the response |
◆ cmd_response_data_set_content_type()
Set content type of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
[in] | content_type | Content Type to set |
◆ cmd_response_data_set_content_type_string()
void cmd_response_data_set_content_type_string |
( |
cmd_response_data_t * |
data, |
|
|
gchar * |
content_type_string |
|
) |
| |
Set a content type as string.
If content type is set as a string content_type is set to GSAD_CONTENT_TYPE_STRING.
- Parameters
-
[in] | data | Command response data struct |
[in] | content_type_string | Content type as string |
◆ cmd_response_data_set_status_code()
Set status code of cmd_response_data_t struct.
- Parameters
-
[in] | data | Command response data struct |
[in] | http_status_code | HTTP status code |