From: reyk Date: Wed, 30 Jul 2014 07:09:38 +0000 (+0000) Subject: Reserve an extra file descriptor per connection instead of per X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6638a4e5cc7db9afcb275061a175709c015ac202;p=openbsd 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@ --- 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;