summaryrefslogtreecommitdiff
path: root/src/other_tools/utils/curl_url_handle.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-11-06 15:40:56 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-11-14 13:35:01 +0100
commit8d656639aa07a9677a7c4c1ce8ce0a68287d99e5 (patch)
tree5406b7cab5a1bcb91a3a1cc12f4731fa6622f0cc /src/other_tools/utils/curl_url_handle.hpp
parent7b4bd58b07edc0b26cbe87121d55ef143a050490 (diff)
downloadjustbuild-8d656639aa07a9677a7c4c1ce8ce0a68287d99e5.tar.gz
curl_url_handle: Allow permissive parsing and URL extraction to be non-fatal
Diffstat (limited to 'src/other_tools/utils/curl_url_handle.hpp')
-rw-r--r--src/other_tools/utils/curl_url_handle.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/other_tools/utils/curl_url_handle.hpp b/src/other_tools/utils/curl_url_handle.hpp
index dbb73baa..dfd278d7 100644
--- a/src/other_tools/utils/curl_url_handle.hpp
+++ b/src/other_tools/utils/curl_url_handle.hpp
@@ -100,6 +100,7 @@ class CurlURLHandle {
/// It allows the user to be very permissive with the types of URL strings
/// it can parse by providing configuration arguments that mirror those
/// provided by the libcurl API (see libcurl docs for effects of each flag).
+ /// \param [in] ignore_fatal Do not log failure if error or exception.
/// \returns Pointer to created object, nullptr on failure to parse with
/// given arguments, or nullopt on an unexpected exception.
[[nodiscard]] auto static CreatePermissive(
@@ -109,8 +110,8 @@ class CurlURLHandle {
bool use_non_support_scheme = false,
bool use_no_authority = false,
bool use_path_as_is = false,
- bool use_allow_space = false) noexcept
- -> std::optional<CurlURLHandlePtr>;
+ bool use_allow_space = false,
+ bool ignore_fatal = false) noexcept -> std::optional<CurlURLHandlePtr>;
/// \brief Creates a duplicate CurlURLHandle object.
/// \returns Pointer to duplicated object, or nullptr on errors.
@@ -118,10 +119,12 @@ class CurlURLHandle {
/// \brief Recomposes the URL from the fields in the stored handle.
/// Flags parallel the libcurl API for handling the scheme and port fields.
+ /// \param [in] ignore_fatal Do not log failure if error or exception.
/// \returns The recomposed URL as a string, or nullopt on errors.
[[nodiscard]] auto GetURL(bool use_default_port = false,
bool use_default_scheme = false,
- bool use_no_default_port = false) noexcept
+ bool use_no_default_port = false,
+ bool ignore_fatal = false) noexcept
-> std::optional<std::string>;
/// \brief Gets the parsed scheme field.