aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-10-10 07:47:40 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-10-10 07:48:18 +0200
commit44e19d68f0fbbc5ddda9a780647bf4838d30d342 (patch)
tree0c076141bb0b2c7cc3c04a30ec65349df2927eaa
parent7944a91707f2803bc716a50d6674069f838d19c9 (diff)
downloadnncmpp-44e19d68f0fbbc5ddda9a780647bf4838d30d342.tar.gz
nncmpp-44e19d68f0fbbc5ddda9a780647bf4838d30d342.tar.xz
nncmpp-44e19d68f0fbbc5ddda9a780647bf4838d30d342.zip
Bump liberty
m---------liberty0
-rw-r--r--nncmpp.c34
2 files changed, 11 insertions, 23 deletions
diff --git a/liberty b/liberty
-Subproject 0b77bdeaf9d28c85d8c558bfe7bcd14117a3f94
+Subproject dc54db906945ac1db84582caeb4c47d4cb89acb
diff --git a/nncmpp.c b/nncmpp.c
index f7546b4..cf54119 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -264,10 +264,7 @@ poller_curl_init (struct poller_curl *self, struct poller *poller,
{
memset (self, 0, sizeof *self);
if (!(self->multi = curl_multi_init ()))
- {
- error_set (e, "cURL setup failed");
- return false;
- }
+ return error_set (e, "cURL setup failed");
CURLMcode mres;
if ((mres = curl_multi_setopt (self->multi,
@@ -277,10 +274,9 @@ poller_curl_init (struct poller_curl *self, struct poller *poller,
|| (mres = curl_multi_setopt (self->multi, CURLMOPT_SOCKETDATA, self))
|| (mres = curl_multi_setopt (self->multi, CURLMOPT_TIMERDATA, self)))
{
- error_set (e, "%s: %s",
- "cURL setup failed", curl_multi_strerror (mres));
curl_multi_cleanup (self->multi);
- return false;
+ return error_set (e, "%s: %s",
+ "cURL setup failed", curl_multi_strerror (mres));
}
poller_timer_init (&self->timer, (self->poller = poller));
@@ -310,10 +306,7 @@ poller_curl_spawn (struct poller_curl_task *task, struct error **e)
{
CURL *easy;
if (!(easy = curl_easy_init ()))
- {
- error_set (e, "cURL setup failed");
- return false;
- }
+ return error_set (e, "cURL setup failed");
// We already take care of SIGPIPE, and native DNS timeouts are only
// a problem for people without the AsynchDNS feature.
@@ -327,9 +320,8 @@ poller_curl_spawn (struct poller_curl_task *task, struct error **e)
|| (res = curl_easy_setopt (easy, CURLOPT_ERRORBUFFER, task->curl_error))
|| (res = curl_easy_setopt (easy, CURLOPT_PRIVATE, task)))
{
- error_set (e, "%s", curl_easy_strerror (res));
curl_easy_cleanup (easy);
- return false;
+ return error_set (e, "%s", curl_easy_strerror (res));
}
task->easy = easy;
@@ -341,22 +333,18 @@ poller_curl_add (struct poller_curl *self, CURL *easy, struct error **e)
{
CURLMcode mres;
// "CURLMOPT_TIMERFUNCTION [...] will be called from within this function"
- if (!(mres = curl_multi_add_handle (self->multi, easy)))
- return true;
-
- error_set (e, "%s", curl_multi_strerror (mres));
- return false;
+ if ((mres = curl_multi_add_handle (self->multi, easy)))
+ return error_set (e, "%s", curl_multi_strerror (mres));
+ return true;
}
static bool
poller_curl_remove (struct poller_curl *self, CURL *easy, struct error **e)
{
CURLMcode mres;
- if (!(mres = curl_multi_remove_handle (self->multi, easy)))
- return true;
-
- error_set (e, "%s", curl_multi_strerror (mres));
- return false;
+ if ((mres = curl_multi_remove_handle (self->multi, easy)))
+ return error_set (e, "%s", curl_multi_strerror (mres));
+ return true;
}
// --- Application -------------------------------------------------------------