diff --git a/lib/downloader.cpp b/lib/downloader.cpp index c45ed90f..c20655f4 100644 --- a/lib/downloader.cpp +++ b/lib/downloader.cpp @@ -200,8 +200,8 @@ namespace HTTP{ MEDIUM_MSG("Posting to %s (%zu/%" PRIu32 ")", link.getUrl().c_str(), retryCount - loop + 1, retryCount); doRequest(link, "POST", payload); - // Not synced? Ignore the response and immediately return false. - if (!sync){return false;} + // Not synced? Ignore the response and immediately return true. + if (!sync){return true;} uint64_t reqTime = Util::bootSecs(); while (getSocket() && Util::bootSecs() < reqTime + dataTimeout){ // No data? Wait for a second or so. diff --git a/lib/triggers.cpp b/lib/triggers.cpp index 56706d3c..3198cd7d 100644 --- a/lib/triggers.cpp +++ b/lib/triggers.cpp @@ -54,7 +54,7 @@ namespace Triggers{ DL.setHeader("X-Trigger", trigger); DL.setHeader("Content-Type", "text/plain"); HTTP::URL url(value); - if (DL.post(url, payload, sync) && sync && DL.isOk()){ + if (DL.post(url, payload, sync) && (!sync || DL.isOk())){ submitTriggerStat(trigger, tStartMs, true); return DL.data(); }