Commit | Line | Data |
6600ff68 |
1 | /* |
0198fd3c |
2 | * tiny-fcgi.c -- |
3 | * |
4 | * FastCGI example program using fcgi_stdio library |
5 | * |
6 | * |
7 | * Copyright (c) 1996 Open Market, Inc. |
8 | * |
9 | * See the file "LICENSE.TERMS" for information on usage and redistribution |
10 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
11 | * |
12 | */ |
13 | |
14 | #ifndef lint |
6600ff68 |
15 | static const char rcsid[] = "$Id: tiny-fcgi.c,v 1.4 1999/07/28 00:35:28 roberts Exp $"; |
0198fd3c |
16 | #endif /* not lint */ |
17 | |
6600ff68 |
18 | #include "fcgi_config.h" |
19 | |
0198fd3c |
20 | #include <stdlib.h> |
21 | |
6600ff68 |
22 | #ifdef HAVE_UNISTD_H |
2fd179ab |
23 | #include <unistd.h> |
24 | #endif |
25 | |
0198fd3c |
26 | #ifdef _WIN32 |
27 | #include <process.h> |
28 | #endif |
29 | |
6600ff68 |
30 | #include "fcgi_stdio.h" |
31 | |
3293ebdf |
32 | int main(void) |
0198fd3c |
33 | { |
34 | int count = 0; |
35 | while(FCGI_Accept() >= 0) { |
36 | printf("Content-type: text/html\r\n" |
37 | "\r\n" |
38 | "<title>FastCGI Hello! (C, fcgi_stdio library)</title>" |
39 | "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>" |
40 | "Request number %d running on host <i>%s</i> " |
41 | "Process ID: %d\n", |
42 | ++count, getenv("SERVER_NAME"), getpid()); |
43 | } |
3293ebdf |
44 | |
45 | return 0; |
0198fd3c |
46 | } |