summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-11 15:26:29 -0400
committerJune McEnroe <june@causal.agency>2020-07-11 15:26:29 -0400
commita947e617b4c0200d72db3f7e15727c9c027b0718 (patch)
treec4887a4dab256929ca354a522e68eb17ff67024a
parentRemove -f option (diff)
downloadscooper-a947e617b4c0200d72db3f7e15727c9c027b0718.tar.gz
scooper-a947e617b4c0200d72db3f7e15727c9c027b0718.zip
Handle KCGI_EXIT and call khttp_fcgi_free
-rw-r--r--server.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server.c b/server.c
index e3261be..61e23bc 100644
--- a/server.c
+++ b/server.c
@@ -130,7 +130,10 @@ int main(int argc, char *argv[]) {
 			error = request(&req);
 			if (error && error != KCGI_HUP) break;
 		}
-		errx(EX_PROTOCOL, "khttp_fcgi_parse: %s", kcgi_strerror(error));
+		if (error != KCGI_EXIT) {
+			errx(EX_PROTOCOL, "khttp_fcgi_parse: %s", kcgi_strerror(error));
+		}
+		khttp_fcgi_free(fcgi);
 	} else {
 		struct kreq req;
 		enum kcgi_err error = khttp_parse(