This commit is contained in:
2026-05-27 06:24:36 -07:00
parent 656b3ade80
commit 3ab01575a2
3 changed files with 13 additions and 8 deletions
+6 -1
View File
@@ -264,7 +264,6 @@ static void handle_put_request(FILE *conn, HTTPRequest *restrict req) {
if (content_length < 0) {
write_audit_log_entry(req, 400);
send_simple_response(conn, 400);
fclose(conn);
return;
}
char temp_file[] = "temp_fileXXXXXX";
@@ -286,6 +285,12 @@ static void handle_put_request(FILE *conn, HTTPRequest *restrict req) {
close(temp_fd);
unlink(temp_file);
return;
} else if (feof(conn)) {
write_audit_log_entry(req, 400);
send_simple_response(conn, 400);
close(temp_fd);
unlink(temp_file);
return;
}
content_length -= read_size;
}