Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Jan 27, 2025
1 parent 3503a65 commit c80bcf4
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/core/AsyncClient/AsyncClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ class AsyncClientClass : public ResultBase, RTDBResultBase

void reserveString(async_data *sData)
{
// String memory reservation is needed to hadle large data in external memory.
// String memory reservation is needed to handle large data in external memory.
#if defined(ENABLE_PSRAM) && ((defined(ESP8266) && defined(MMU_EXTERNAL_HEAP)) || (defined(ESP32) && defined(BOARD_HAS_PSRAM)))
String old = sData->response.val[resns::payload];
sData->response.val[resns::payload].remove(0, sData->response.val[resns::payload].length());
Expand All @@ -1132,7 +1132,7 @@ class AsyncClientClass : public ResultBase, RTDBResultBase
#endif
}

// non-block memory buffer for collecting the multiple of 4 data prepared for base64 decoding
// Non-blocking memory buffer for collecting the data (multiple of 4 bytes) that prepared for base64 decoding
uint8_t *asyncBase64Buffer(async_data *sData, Memory &mem, int &toRead, int &read)
{
uint8_t *buf = nullptr;
Expand Down Expand Up @@ -1348,7 +1348,6 @@ class AsyncClientClass : public ResultBase, RTDBResultBase
{
if (conn.isConnected())
setDebugBase(app_debug, FPSTR("Terminating the server connection..."));

conn.stop();
}

Expand Down Expand Up @@ -1452,10 +1451,7 @@ class AsyncClientClass : public ResultBase, RTDBResultBase
}
}

void setEvent(async_data *sData, int code, const String &msg)
{
setEventBase(app_event, code, msg);
}
void setEvent(async_data *sData, int code, const String &msg) { setEventBase(app_event, code, msg); }

void removeSlot(uint8_t slot, bool sse = true)
{
Expand Down Expand Up @@ -1489,14 +1485,10 @@ class AsyncClientClass : public ResultBase, RTDBResultBase

size_t slotCount() { return sVec.size(); }

void exitProcess(bool status)
{
inProcess = status;
}
void exitProcess(bool status) { inProcess = status; }

void process(bool async)
{

if (processLocked())
return;

Expand Down Expand Up @@ -1809,7 +1801,7 @@ class AsyncClientClass : public ResultBase, RTDBResultBase
void setNetwork(Client &client, network_config_data &net)
{
// Check client changes.
bool client_changed = reinterpret_cast<uint32_t>(&client) != reinterpret_cast<uint32_t>(this->client);
bool client_changed = reinterpret_cast<uint32_t>(&client) != reinterpret_cast<uint32_t>(this->client);

// Some changes, stop the current network client.
if (client_changed && this->client)
Expand Down

0 comments on commit c80bcf4

Please sign in to comment.