From 58cc227cbab3041ca0520052675cfaba36cd7f31 Mon Sep 17 00:00:00 2001 From: Russ Dill Date: Fri, 4 Feb 2022 22:58:32 -0800 Subject: [PATCH] Don't close evbuffer_add_file's file descriptor evbuffer_add_file takes ownership for the file descriptor we pass and manages closing it. Closing it ourselves will lead to the function only being able to make very small transfers. Signed-off-by: Russ Dill --- src/ustreamer/http/server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ustreamer/http/server.c b/src/ustreamer/http/server.c index 7908640..2c01c59 100644 --- a/src/ustreamer/http/server.c +++ b/src/ustreamer/http/server.c @@ -317,6 +317,7 @@ static void _http_callback_static(struct evhttp_request *request, void *v_server goto not_found; } + fd = -1; ADD_HEADER("Content-Type", guess_mime_type(static_path)); evhttp_send_reply(request, HTTP_OK, "OK", buf); goto cleanup;