diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:03:34 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:03:34 +0100 |
commit | eb45c46b906e492f063f1469486190e93ff340ff (patch) | |
tree | 85d615969fa7bf8056a05b59006f77bc63e85892 /tests/fcgi-responder.c | |
parent | 6426b37107707a1d95ffd03f68620cbda8bdb942 (diff) | |
download | lighttpd-eb45c46b906e492f063f1469486190e93ff340ff.tar.gz |
Imported Upstream version 1.4.10upstream/1.4.10
Diffstat (limited to 'tests/fcgi-responder.c')
-rw-r--r-- | tests/fcgi-responder.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/fcgi-responder.c b/tests/fcgi-responder.c new file mode 100644 index 0000000..7fbaf28 --- /dev/null +++ b/tests/fcgi-responder.c @@ -0,0 +1,40 @@ +#include <fcgi_stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> + +int main () { + int num_requests = 2; + + while (num_requests > 0 && + FCGI_Accept() >= 0) { + char* p; + + if (NULL != (p = getenv("QUERY_STRING"))) { + if (0 == strcmp(p, "lf")) { + printf("Status: 200 OK\n\n"); + } else if (0 == strcmp(p, "crlf")) { + printf("Status: 200 OK\r\n\r\n"); + } else if (0 == strcmp(p, "slow-lf")) { + printf("Status: 200 OK\n"); + fflush(stdout); + printf("\n"); + } else if (0 == strcmp(p,"slow-crlf")) { + printf("Status: 200 OK\r\n"); + fflush(stdout); + printf("\r\n"); + } else if (0 == strcmp(p, "die-at-end")) { + printf("Status: 200 OK\r\n\r\n"); + num_requests--; + } else { + printf("Status: 200 OK\r\n\r\n"); + } + } else { + printf("Status: 500 Internal Foo\r\n\r\n"); + } + + printf("test123"); + } + + return 0; +} |