summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-05-04 15:46:50 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2019-05-04 16:36:10 -0400
commit60a4b5f1183e168cff378d99a43290bfc102de6b (patch)
tree6ea3a9e10524fd48136e6c758d3e3dcff87dee9d
parent8cc189f4c6c269b5efd787fca372bfb4e5af141e (diff)
downloadlighttpd1.4-60a4b5f1183e168cff378d99a43290bfc102de6b.tar.gz
lighttpd1.4-60a4b5f1183e168cff378d99a43290bfc102de6b.zip
[stat_cache] FAM: separate routine for FDEVENT_IN
-rw-r--r--src/stat_cache.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/stat_cache.c b/src/stat_cache.c
index ec2531c9..45d6139c 100644
--- a/src/stat_cache.c
+++ b/src/stat_cache.c
@@ -243,11 +243,8 @@ static void stat_cache_delete_tree(server *srv, const char *name, size_t len);
static void stat_cache_invalidate_entry(server *srv, const char *name, size_t len);
static void stat_cache_invalidate_dir_tree(server *srv, const char *name, size_t len);
-static handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent) {
- stat_cache_fam *scf = srv->stat_cache->scf;
- UNUSED(_fce);
-
- if (revent & FDEVENT_IN) {
+static void stat_cache_handle_fdevent_in(server *srv, stat_cache_fam *scf)
+{
for (int i = 0, ndx; i || (i = FAMPending(&scf->fam)) > 0; --i) {
FAMEvent fe;
if (FAMNextEvent(&scf->fam, &fe) < 0) break;
@@ -330,6 +327,15 @@ static handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent)
break;
}
}
+}
+
+static handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent)
+{
+ stat_cache_fam *scf = srv->stat_cache->scf;
+ UNUSED(_fce);
+
+ if (revent & FDEVENT_IN) {
+ stat_cache_handle_fdevent_in(srv, scf);
}
if (revent & (FDEVENT_HUP|FDEVENT_RDHUP)) {