From 9f5b18e73c965f9174246861545dce4008779a48 Mon Sep 17 00:00:00 2001 From: Bang Kwang-Min Date: Mon, 18 Mar 2013 19:28:27 +0900 Subject: [PATCH] new API : download_get_http_header_field_list Change-Id: I0a6451c703179e1605f9f7bc1983121b6c63ca5c --- include/download.h | 17 +++++++++++++++++ src/download-wrapping.c | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/include/download.h b/include/download.h index 8006958..3a137de 100755 --- a/include/download.h +++ b/include/download.h @@ -510,6 +510,23 @@ int download_add_http_header_field(int download_id, const char *field, const cha */ int download_get_http_header_field(int download_id, const char *field, char **value); +/** + * @brief Gets all of the field added to the download request + * + * @remarks The @a value must be released with free() by you. + * @param [in] download The download id + * @param [out] the array of the HTTP header fields + * @param [out] the number of the HTTP header fields + * @return 0 on success, otherwise a negative error value. + * @retval #DOWNLOAD_ERROR_NONE Successful + * @retval #DOWNLOAD_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #DOWNLOAD_ERROR_OUT_OF_MEMORY Out of memory + * @retval #DOWNLOAD_ERROR_INVALID_STATE Invalid state + * @retval #DOWNLOAD_ERROR_ID_NOT_FOUND No Download ID + * @see download_add_http_header_field() + * @see download_remove_http_header_field() + */ +int download_get_http_header_field_list(int download_id, char ***fields, int *length); /** * @brief Removes the given HTTP header field from the download diff --git a/src/download-wrapping.c b/src/download-wrapping.c index aa54426..94b7fd2 100755 --- a/src/download-wrapping.c +++ b/src/download-wrapping.c @@ -196,6 +196,14 @@ int download_get_http_header_field(int download_id, dp_interface_get_http_header_field(download_id, field, value); } +int download_get_http_header_field_list(int download_id, char ***fields, + int *length) +{ + TRACE_INFO(""); + return dp_interface_get_http_header_field_list(download_id, fields, + length); +} + int download_remove_http_header_field(int download_id, const char *field) { -- 2.34.1