v1.9.2 not to reconnect after connected

### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/12)
2. Update `Packages' Patches`
This commit is contained in:
Khoi Hoang
2022-10-18 22:36:53 -04:00
committed by GitHub
parent dcdf3dc5f9
commit 79f62c3f4a
23 changed files with 150 additions and 90 deletions

View File

@ -139,15 +139,14 @@ void sendRequests()
reqCount[1] = NUM_ENTRIES_SITE_1;
}
void requestCB0(void* optParm, AsyncHTTPRequest* thisRequest, int readyState)
{
(void) optParm;
if (readyState == readyStateDone)
{
AHTTP_LOGERROR(F("\n**************************************"));
AHTTP_LOGERROR1(F("Response Code = "), request->responseHTTPString());
AHTTP_LOGWARN(F("\n**************************************"));
AHTTP_LOGWARN1(F("Response Code = "), request->responseHTTPString());
if (request->responseHTTPcode() == 200)
{
@ -171,8 +170,8 @@ void requestCB1(void* optParm, AsyncHTTPRequest* thisRequest, int readyState)
if (readyState == readyStateDone)
{
AHTTP_LOGERROR(F("\n**************************************"));
AHTTP_LOGERROR1(F("Response Code = "), request->responseHTTPString());
AHTTP_LOGWARN(F("\n**************************************"));
AHTTP_LOGWARN1(F("Response Code = "), request->responseHTTPString());
if (request->responseHTTPcode() == 200)
{
@ -207,7 +206,7 @@ void setup()
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
delay(1000);
Serial.print(".");
}
@ -231,12 +230,11 @@ void loop()
for (int index = 0; index < NUM_DIFFERENT_SITES; index++)
{
if ((reqCount[index] > 0) && readySend[index])
// OK but have to use delay(100)
//if ( reqCount[index] > 0 )
{
sendRequestCB[index]();
//delay(100);
// Don't send too fast
delay(1000);
}
}
}