8000 Added heap logging · quentin/esp32_https_server@ac4f723 · GitHub
[go: up one dir, main page]

Skip to content

Commit ac4f723

Browse files
committed
Added heap logging
1 parent f62add5 commit ac4f723

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

https/HTTPSConnection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ int HTTPSConnection::initialize(int serverSocketID, SSL_CTX * sslCtx, HTTPHeader
7070
} else {
7171
HTTPS_DLOG("[ERR] SSL_new failed. Aborting handshake.");
7272
}
73+
} else {
74+
HTTPS_DLOG("[ERR] Could not accept() new connection");
7375
}
7476
_connectionState = STATE_ERROR;
7577
_clientState = CSTATE_ACTIVE;

https_server.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,13 @@ void setup()
215215
// The loop function is called in an endless loop
216216
void loop() {
217217
// Use your normal loop without thinking of the server in the background
218-
Serial.println("Hello from main loop!");
219218

220-
// Delay for about half a minute and print some message on the Serial console.
221-
delay(30*1000);
219+
// Delay for about five seconds and print some message on the Serial console.
220+
delay(5 * 1000);
221+
222+
// We use this loop only to show memory usage for debugging purposes
223+ uint32_t freeheap = ESP.getFreeHeap();
224+
Serial.printf("Free Heap: %9d \n", freeheap);
222225
}
223226

224227
/**

0 commit comments

Comments
 (0)
0