Skip to content

Commit 015dc0d

Browse files
committed
Fix missing error recovery in libhttpd/api.c
The select call sometimes may be interrupted or otherwise return a value < 0. In this case, we do want to signal an error to the caller. For subsequent calls, the error need to be reset or the caller (gateway.c) will keep going into the error handler path even though the HTTP request was handled succesfully.
1 parent 98fce11 commit 015dc0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libhttpd/api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ struct timeval *timeout;
311311
socklen_t addrLen;
312312
char *ipaddr;
313313
request *r;
314-
314+
/* Reset error */
315+
server->lastError = 0;
315316
FD_ZERO(&fds);
316317
FD_SET(server->serverSock, &fds);
317318
result = 0;

0 commit comments

Comments
 (0)