diff --git a/0003-curl-add-a-helper-for-HTTP-GET.patch b/0003-curl-add-a-helper-for-HTTP-GET.patch new file mode 100644 index 0000000..44b35fc --- /dev/null +++ b/0003-curl-add-a-helper-for-HTTP-GET.patch @@ -0,0 +1,69 @@ +From 85e6d59c4c9aeabb16cb9e0c68f13933b2c7ed7b Mon Sep 17 00:00:00 2001 +From: Jakub Filak +Date: Tue, 25 Aug 2015 15:49:13 +0200 +Subject: [PATCH] curl: add a helper for HTTP GET + +Please do not think I am an idiot but I really do not see any better way +to enable ABRT to use HTTP GET through libreport helper functions. + +Related: rhbz#1256493 + +Signed-off-by: Jakub Filak +--- + src/include/libreport_curl.h | 10 ++++++++++ + src/lib/curl.c | 4 ++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/include/libreport_curl.h b/src/include/libreport_curl.h +index 4b41ecc..5478fa6 100644 +--- a/src/include/libreport_curl.h ++++ b/src/include/libreport_curl.h +@@ -70,6 +70,7 @@ enum { + POST_DATA_FROMFILE_PUT = -3, + POST_DATA_FROMFILE_AS_FORM_DATA = -4, + POST_DATA_STRING_AS_FORM_DATA = -5, ++ POST_DATA_GET = -6, + }; + int + post(post_state_t *state, +@@ -79,6 +80,15 @@ post(post_state_t *state, + const char *data, + off_t data_size); + static inline int ++get(post_state_t *state, ++ const char *url, ++ const char *content_type, ++ const char **additional_headers) ++{ ++ return post(state, url, content_type, additional_headers, ++ NULL, POST_DATA_GET); ++} ++static inline int + post_string(post_state_t *state, + const char *url, + const char *content_type, +diff --git a/src/lib/curl.c b/src/lib/curl.c +index f7321b5..c927ece 100644 +--- a/src/lib/curl.c ++++ b/src/lib/curl.c +@@ -351,7 +351,7 @@ post(post_state_t *state, + xcurl_easy_setopt_ptr(handle, CURLOPT_PASSWORD, (state->password ? state->password : "")); + } + +- if (data_size != POST_DATA_FROMFILE_PUT) ++ if (data_size != POST_DATA_FROMFILE_PUT && data_size != POST_DATA_GET) + { + // Do a HTTP POST. This also makes curl use + // a "Content-Type: application/x-www-form-urlencoded" header. +@@ -459,7 +459,7 @@ post(post_state_t *state, + error_msg_and_die("out of memory or read error (curl_formadd error code: %d)", (int)curlform_err); + xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPPOST, post); + } +- else ++ else if (data_size != POST_DATA_GET) + { + // ...from a blob in memory + xcurl_easy_setopt_ptr(handle, CURLOPT_POSTFIELDS, data); +-- +2.5.0 + diff --git a/libreport.spec b/libreport.spec index de06286..1efdcca 100644 --- a/libreport.spec +++ b/libreport.spec @@ -7,7 +7,7 @@ Summary: Generic library for reporting various problems Name: libreport Version: 2.6.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: https://abrt.readthedocs.org/ @@ -18,6 +18,7 @@ Source1: autogen.sh # i=0; for p in `ls 0*.patch`; do printf "Patch%04d: %s\n" $i $p; ((i++)); done Patch0001: 0001-dd-stop-warning-about-corrupted-mandatory-files.patch Patch0002: 0002-dd-don-t-warn-about-missing-type-if-the-locking-fail.patch +Patch0003: 0003-curl-add-a-helper-for-HTTP-GET.patch # git is need for '%%autosetup -S git' which automatically applies all the # patches above. Please, be aware that the patches must be generated @@ -738,6 +739,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Wed Aug 26 2015 Matej Habrnal 2.6.2-3 +- add a helper for HTTP GET + * Fri Aug 14 2015 Matej Habrnal 2.6.2-2 - don't warn about missing 'type' if the locking fails - stop warning about corrupted mandatory files