Skip to content

Commit

Permalink
fix: timeout setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Jun 27, 2024
1 parent bada98c commit 3c92ae5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"maintainer": true
}
],
"version": "13.3.1",
"version": "13.3.2",
"frameworks": ["espidf", "arduino"],
"platforms": "espressif32"
}
12 changes: 6 additions & 6 deletions src/rbwebserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,13 @@ static void tiny_web_task(void* portPtr) {
while (xTaskNotifyWait(0, 0xFFFFFFFF, (uint32_t*)&stopping_task, pdMS_TO_TICKS(10)) == pdFALSE) {
connfd = accept(listenfd, (SA*)&clientaddr, &clientlen);

// 5s timeout on writes
struct timeval timeout;
timeout.tv_sec = 5;
timeout.tv_usec = 0;
setsockopt(connfd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));

if (connfd >= 0) {
// 5s timeout on writes
struct timeval timeout;
timeout.tv_sec = 5;
timeout.tv_usec = 0;
setsockopt(connfd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));

if(process(connfd, &clientaddr) <= 0) {
close(connfd);
} else {
Expand Down

0 comments on commit 3c92ae5

Please sign in to comment.