Skip to content

Commit 27055fd

Browse files
committed
fix(mosq): Fix misleading error when accepting connection
Closes #807
1 parent c416976 commit 27055fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/mosquitto/port/net__esp_tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ struct mosquitto *net__socket_accept(struct mosquitto__listener_sock *listensock
105105
struct mosquitto *new_context;
106106

107107
new_sock = accept(listensock->sock, NULL, 0);
108-
if (new_sock == INVALID_SOCKET) {
108+
if (errno == ERR_MEM || errno == ERR_VAL) {
109109
log__printf(NULL, MOSQ_LOG_ERR,
110110
"Unable to accept new connection, system socket count has been exceeded. Try increasing \"ulimit -n\" or equivalent.");
111111
return NULL;

0 commit comments

Comments
 (0)