Skip to content

Commit

Permalink
Revert the web client.setTimeout
Browse files Browse the repository at this point in the history
I believe this may be causing problems with OTA updates.
we should revisit this later
  • Loading branch information
jgstroud committed Apr 4, 2024
1 parent f77a5b1 commit e229d15
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,6 @@ void handle_setgdo()
void SSEheartbeat(uint8_t channel, SSESubscription *s)
{
// RINFO("SSEheartbeat - Client %s on channel %d", s->clientIP.toString().c_str(), channel);
size_t txsize;
uint32_t free_heap = system_get_free_heap_size();
if (free_heap < min_heap)
min_heap = free_heap;
Expand Down Expand Up @@ -667,12 +666,11 @@ void SSEheartbeat(uint8_t channel, SSESubscription *s)
return;
}

txsize = 0;
if (s->client.connected())
{
txsize = s->client.printf("event: message\nretry: 15000\ndata: %s\n\n", json);
s->client.printf("event: message\nretry: 15000\ndata: %s\n\n", json);
}
if (txsize == 0)
else
{
RINFO("SSEheartbeat - client not listening on channel %d, remove subscription", channel);
s->heartbeatTimer.detach();
Expand Down Expand Up @@ -702,7 +700,6 @@ void SSEHandler(uint8_t channel)
}
client.setNoDelay(true);
client.setSync(true);
client.setTimeout(500);
s.client = client; // capture SSE server client connection
server.setContentLength(CONTENT_LENGTH_UNKNOWN); // the payload can go on forever
/*
Expand Down

0 comments on commit e229d15

Please sign in to comment.