summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2021-05-03 10:49:51 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2021-05-03 10:49:51 +0100
commit8da45730880467ea5defe010c58ac1ec7ca74c4e (patch)
treee25831ff7f821a5b05a5d4fae026d95fca23ca2e /file.c
parentc03b57465bdf850026b3a5c478a63ca62212720f (diff)
Fire check callback after cleaning up event so it does not get stuck, from
Jeongho Jang in GitHub issue 2695.
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/file.c b/file.c
index baa2bd58..974c8a37 100644
--- a/file.c
+++ b/file.c
@@ -503,14 +503,14 @@ file_write_error_callback(__unused struct bufferevent *bev, __unused short what,
log_debug("write error file %d", cf->stream);
- if (cf->cb != NULL)
- cf->cb(NULL, NULL, 0, -1, NULL, cf->data);
-
bufferevent_free(cf->event);
cf->event = NULL;
close(cf->fd);
cf->fd = -1;
+
+ if (cf->cb != NULL)
+ cf->cb(NULL, NULL, 0, -1, NULL, cf->data);
}
/* Client file write callback. */