2008-02-25 06:56:48 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2006-10-03 22:22:47 +00:00
|
|
|
#include "config.h"
|
2008-02-25 06:56:48 +00:00
|
|
|
#endif
|
2006-10-03 22:22:47 +00:00
|
|
|
#ifdef HAVE_FASTCGI_FASTCGI_H
|
|
|
|
#include <fastcgi/fcgi_stdio.h>
|
|
|
|
#else
|
2005-02-20 14:27:00 +00:00
|
|
|
#include <fcgi_stdio.h>
|
2006-10-03 22:22:47 +00:00
|
|
|
#endif
|
2005-02-20 14:27:00 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2012-08-31 14:11:41 +00:00
|
|
|
int main (void) {
|
2005-02-20 14:27:00 +00:00
|
|
|
char* p;
|
2006-10-05 00:09:51 +00:00
|
|
|
|
|
|
|
while (FCGI_Accept() >= 0) {
|
2005-02-20 14:27:00 +00:00
|
|
|
/* wait for fastcgi authorizer request */
|
2006-10-05 00:09:51 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
printf("Content-type: text/html\r\n");
|
2006-10-05 00:09:51 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (((p = getenv("QUERY_STRING")) == NULL) ||
|
|
|
|
strcmp(p, "ok") != 0) {
|
|
|
|
printf("Status: 403 Forbidden\r\n\r\n");
|
2006-10-05 00:09:51 +00:00
|
|
|
} else {
|
2005-02-20 14:27:00 +00:00
|
|
|
printf("\r\n");
|
|
|
|
/* default Status is 200 - allow access */
|
|
|
|
}
|
2006-10-05 00:09:51 +00:00
|
|
|
|
|
|
|
printf("foobar\r\n");
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|