Fixed sync bug in HTTP trigger handler
This commit is contained in:
parent
f77f1bc14d
commit
cdc8f0179f
2 changed files with 3 additions and 3 deletions
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue