Skip to content

Commit 2ea218f

Browse files
committed
Don't call close_connection() on the same client_t pointer twice.
1 parent 3ca872f commit 2ea218f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/httpserver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ int on_url(http_parser *parser, const char *data, size_t len) {
281281
client->url.append(data, len);
282282
DPRINTF("URL is now: %s\n", client->url.c_str());
283283
if (client->url.size() > MAX_URL_SIZE) {
284-
// An obviously buggy request.
285-
close_connection(client);
284+
// An obviously buggy request. The on_resume_read() function
285+
// will close the connection.
286+
DPRINTF("URL too long (%d > %d bytes)\n", client->url.size(), MAX_URL_SIZE);
286287
return HTTP_PARSER_STOP_PARSING;
287288
}
288289
return HTTP_PARSER_CONTINUE_PARSING;

0 commit comments

Comments
 (0)