8000 Merge pull request #4 from abelsensors/feature/VV-3453_FixWatchdogTim… · abelsensors/esp32_https_server@3181cb3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3181cb3

Browse files
authored
Merge pull request #4 from abelsensors/feature/VV-3453_FixWatchdogTimeouts
VV-3453 Add timeout check to HTTPConnection::updateBuffer
2 parents 6cf1aed + 6bbc5a8 commit 3181cb3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/HTTPConnection.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,14 @@ int HTTPConnection::updateBuffer() {
211211
closeConnection();
212212
return -1;
213213
}
214-
215-
} // data pending
214+
// 6F9E This function can be called in a loop when discarding the request body in HTTPRequest::discardRequestBody.
215+
// When the connection for whatever reason is unable to receive more data, the application essentially gets
216+
// stuck in an infinite while loop. This extra timeout check prevents this from occurring.
217+
} else if (isTimeoutExceeded()) {
218+
HTTPS_LOGI("Connection timeout. FID=%d", _socket);
219+
closeConnection();
220+
return -1;
221+
}
216222

217223
} // buffer can read more
218224
}

0 commit comments

Comments
 (0)
0