[mod_ssi] produce content in subrequest hook
[lighttpd.git] / tests / fcgi-responder.c
blob8a86a73de44697b4b5a8fec281153f4fcb07e496
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4 #ifdef HAVE_FASTCGI_FASTCGI_H
5 #include <fastcgi/fcgi_stdio.h>
6 #else
7 #include <fcgi_stdio.h>
8 #endif
9 #include <stdlib.h>
10 #include <unistd.h>
11 #include <string.h>
13 int main (void) {
14 int num_requests = 2;
16 while (num_requests > 0 &&
17 FCGI_Accept() >= 0) {
18 char* p;
20 if (NULL != (p = getenv("QUERY_STRING"))) {
21 if (0 == strcmp(p, "lf")) {
22 printf("Status: 200 OK\n\n");
23 } else if (0 == strcmp(p, "crlf")) {
24 printf("Status: 200 OK\r\n\r\n");
25 } else if (0 == strcmp(p, "slow-lf")) {
26 printf("Status: 200 OK\n");
27 fflush(stdout);
28 printf("\n");
29 } else if (0 == strcmp(p,"slow-crlf")) {
30 printf("Status: 200 OK\r\n");
31 fflush(stdout);
32 printf("\r\n");
33 } else if (0 == strcmp(p, "die-at-end")) {
34 printf("Status: 200 OK\r\n\r\n");
35 num_requests--;
36 } else {
37 printf("Status: 200 OK\r\n\r\n");
39 } else {
40 printf("Status: 500 Internal Foo\r\n\r\n");
43 if (0 == strcmp(p, "path_info")) {
44 printf("%s", getenv("PATH_INFO"));
45 } else if (0 == strcmp(p, "script_name")) {
46 printf("%s", getenv("SCRIPT_NAME"));
47 } else if (0 == strcmp(p, "var")) {
48 p = getenv("X_LIGHTTPD_FCGI_AUTH");
49 printf("%s", p ? p : "(no value)");
50 } else {
51 printf("test123");
55 return 0;