Skip to content

Commit

Permalink
Set timeout for HTTP requests to 10 sec
Browse files Browse the repository at this point in the history
  • Loading branch information
nmtoblum committed Jan 18, 2020
1 parent 45638dc commit 90afc73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/request_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ boolean requestJsonApi(JsonDocument& doc, String url, String payload = "", size_

// DBG_PRINT("[HTTPS] begin...\n");
if (https.begin(*client, url)) { // HTTPS
https.setConnectTimeout(10000);
https.setTimeout(10000);

// Send auth header?
if (sendAuth) {
Expand Down Expand Up @@ -64,8 +66,8 @@ boolean requestJsonApi(JsonDocument& doc, String url, String payload = "", size_
}
} else {
DBG_PRINTLN(F("[HTTPS] Unable to connect"));
return false;
}
return false;
}


Expand Down

0 comments on commit 90afc73

Please sign in to comment.