From 48548f0896b0858674ffb4297fee9021a4164841 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 22 Aug 2023 23:17:43 +0900 Subject: [PATCH] Remove unused functions (#2289) --- src/curl_util.cpp | 48 ----------------------------------------------- src/curl_util.h | 1 - 2 files changed, 49 deletions(-) diff --git a/src/curl_util.cpp b/src/curl_util.cpp index edd075b..595c493 100644 --- a/src/curl_util.cpp +++ b/src/curl_util.cpp @@ -37,23 +37,6 @@ // This function is like curl_slist_append function, but this adds data by a-sorting. // Because AWS signature needs sorted header. // -struct curl_slist* curl_slist_sort_insert(struct curl_slist* list, const char* data) -{ - if(!data){ - return list; - } - std::string strkey = data; - std::string strval; - - std::string::size_type pos = strkey.find(':', 0); - if(std::string::npos != pos){ - strval = strkey.substr(pos + 1); - strkey.erase(pos); - } - - return curl_slist_sort_insert(list, strkey.c_str(), strval.c_str()); -} - struct curl_slist* curl_slist_sort_insert(struct curl_slist* list, const char* key, const char* value) { if(!key){ @@ -176,37 +159,6 @@ std::string get_header_value(const struct curl_slist* list, const std::string &k return ""; } -std::string get_canonical_headers(const struct curl_slist* list) -{ - std::string canonical_headers; - - if(!list){ - canonical_headers = "\n"; - return canonical_headers; - } - - for( ; list; list = list->next){ - std::string strhead = list->data; - size_t pos; - if(std::string::npos != (pos = strhead.find(':', 0))){ - std::string strkey = trim(lower(strhead.substr(0, pos))); - std::string strval = trim(strhead.substr(pos + 1)); - if (strval.empty()) { - // skip empty-value headers (as they are discarded by libcurl) - continue; - } - strhead = strkey; - strhead += ":"; - strhead += strval; - }else{ - strhead = trim(lower(strhead)); - } - canonical_headers += strhead; - canonical_headers += "\n"; - } - return canonical_headers; -} - std::string get_canonical_headers(const struct curl_slist* list, bool only_amz) { std::string canonical_headers; diff --git a/src/curl_util.h b/src/curl_util.h index b04ef0a..8dc0d7d 100644 --- a/src/curl_util.h +++ b/src/curl_util.h @@ -28,7 +28,6 @@ enum class sse_type_t; //---------------------------------------------- // Functions //---------------------------------------------- -struct curl_slist* curl_slist_sort_insert(struct curl_slist* list, const char* data); struct curl_slist* curl_slist_sort_insert(struct curl_slist* list, const char* key, const char* value); struct curl_slist* curl_slist_remove(struct curl_slist* list, const char* key); std::string get_sorted_header_keys(const struct curl_slist* list);