Close the connection when an SCGI header does not fit the buffer.

A malformed header aborted the process from the SCGI thread.
This commit is contained in:
xirvik
2026-08-10 02:13:54 +00:00
committed by Jari Sundell
parent 224f06fdc2
commit 781520fef8
+5 -1
View File
@@ -94,8 +94,12 @@ SCgiTask::event_read() {
if (m_content_length == 0)
read_length--;
if (read_length <= 0)
if (read_length <= 0) {
if (m_content_length == 0)
return close();
throw torrent::internal_error("SCgiTask::event_read() no space in buffer for event_read.");
}
int bytes = ::recv(file_descriptor(), m_buffer.data() + m_position, read_length, 0);