File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / lighttpd / tests / fcgi-auth.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 10:32:47 2013 UTC (11 years ago) by misho
Branches: lighttpd, MAIN
CVS tags: v1_4_41p8, v1_4_35p0, v1_4_35, v1_4_33, HEAD
1.4.33

    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>
   12: 
   13: int main (void) {
   14: 	char* p;
   15: 
   16: 	while (FCGI_Accept() >= 0) {
   17: 		/* wait for fastcgi authorizer request */
   18: 
   19: 		printf("Content-type: text/html\r\n");
   20: 
   21: 		if (((p = getenv("QUERY_STRING")) == NULL) ||
   22: 		    strcmp(p, "ok") != 0) {
   23: 			printf("Status: 403 Forbidden\r\n\r\n");
   24: 		} else {
   25: 			printf("\r\n");
   26: 			/* default Status is 200 - allow access */
   27: 		}
   28: 
   29: 		printf("foobar\r\n");
   30: 	}
   31: 
   32: 	return 0;
   33: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>