Clarify when the socket is closed if a custom session closing callback is used

When using a custom session closing callback, the IDF will not close the socket for the user. This might result in the system running out of fds. Without any note on that in the documentation, this is easy to miss.
This commit is contained in:
FlorianR
2021-11-22 11:55:24 +01:00
committed by bot
parent ef98a363e3
commit 4db3fd17d9

View File

@@ -206,6 +206,9 @@ typedef struct httpd_config {
* Called when a session is deleted, before freeing user and transport contexts and before
* closing the socket. This is a place for custom de-init code common to all sockets.
*
* The server will only close the socket if no custom session closing callback is set.
* If a custom callback is used, `close(sockfd)` should be called in here for most cases.
*
* Set the user or transport context to NULL if it was freed here, so the server does not
* try to free it again.
*