From 6638a4e5cc7db9afcb275061a175709c015ac202 Mon Sep 17 00:00:00 2001 From: reyk Date: Wed, 30 Jul 2014 07:09:38 +0000 Subject: [PATCH] Reserve an extra file descriptor per connection instead of per request. This fixes fd accounting with persistent connections and reduces the complexity of the implementation. ok benno@ --- usr.sbin/httpd/server_file.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/usr.sbin/httpd/server_file.c b/usr.sbin/httpd/server_file.c index 3d364ed7ed2..5101d3952fd 100644 --- a/usr.sbin/httpd/server_file.c +++ b/usr.sbin/httpd/server_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_file.c,v 1.18 2014/07/29 16:17:28 reyk Exp $ */ +/* $OpenBSD: server_file.c,v 1.19 2014/07/30 07:09:38 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter @@ -170,9 +170,6 @@ server_file(struct httpd *env, struct client *clt) if ((fd = open(path, O_RDONLY)) == -1) goto fail; - /* File descriptor is opened, decrement inflight counter */ - server_inflight_dec(clt, __func__); - media = media_find(env->sc_mediatypes, path); ret = server_response_http(clt, 200, media, st.st_size); switch (ret) { @@ -235,9 +232,6 @@ server_file_index(struct httpd *env, struct client *clt) if ((fd = open(path, O_RDONLY)) == -1) goto fail; - /* File descriptor is opened, decrement inflight counter */ - server_inflight_dec(clt, __func__); - if ((evb = evbuffer_new()) == NULL) goto fail; -- 2.20.1