diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2020-12-18 16:11:59 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-12-18 20:36:30 -0500 |
commit | c68a7b4552b49052b3876a3e41d772ab051a1d3c (patch) | |
tree | 7d2a6252e1bd0b34bfa24268e293d4cea5d6b85a | |
parent | 0bff6d58bc2ab5e9a0829f464cf8f6a407c9b4ae (diff) | |
download | lighttpd-git-c68a7b4552b49052b3876a3e41d772ab051a1d3c.tar.gz |
[tests] collect code for "die-at-end" tests
-rw-r--r-- | tests/fcgi-responder.c | 10 | ||||
-rw-r--r-- | tests/scgi-responder.c | 4 |
2 files changed, 5 insertions, 9 deletions
diff --git a/tests/fcgi-responder.c b/tests/fcgi-responder.c index d04bc32e..be626ee2 100644 --- a/tests/fcgi-responder.c +++ b/tests/fcgi-responder.c @@ -11,10 +11,8 @@ #include <string.h> int main (void) { - int num_requests = 1; - while (num_requests > 0 && - FCGI_Accept() >= 0) { + while (FCGI_Accept() >= 0) { char* p; if (NULL != (p = getenv("QUERY_STRING"))) { @@ -32,7 +30,9 @@ int main (void) { printf("\r\n"); } else if (0 == strcmp(p, "die-at-end")) { printf("Status: 200 OK\r\n\r\n"); - num_requests--; + printf("test123"); + FCGI_Finish(); + break; } else { printf("Status: 200 OK\r\n\r\n"); } @@ -50,8 +50,6 @@ int main (void) { } else { printf("test123"); } - - if (0 == num_requests) FCGI_Finish(); } return 0; diff --git a/tests/scgi-responder.c b/tests/scgi-responder.c index 969c616b..96c10695 100644 --- a/tests/scgi-responder.c +++ b/tests/scgi-responder.c @@ -56,7 +56,6 @@ static void scgi_process (const int fd) { ssize_t rd = 0, offset = 0; - int num_requests = 1; char *p = NULL, *r; unsigned long rlen; long long cl; @@ -178,7 +177,7 @@ scgi_process (const int fd) printf("\r\n"); } else if (0 == strcmp(p, "die-at-end")) { printf("Status: 200 OK\r\n\r\n"); - num_requests--; + finished = 1; } else { printf("Status: 200 OK\r\n\r\n"); } @@ -199,7 +198,6 @@ scgi_process (const int fd) } fflush(stdout); - if (0 == num_requests) finished = 1; } |