-
Notifications
You must be signed in to change notification settings - Fork 10
chl_fcgi_next
it4e edited this page Oct 4, 2016
·
2 revisions
<chl/chl.h>
chl_fcgi_next, CHL FastCGI next
char chl_fcgi_next();
The chl_fcgi_next function is used to wait for and accept incoming HTTP requests.
The function should be put in a loop, where it then sits idle and waits for a request to be issued. The handling of the request should be put inside the loop brackets.
No arguments.
1 if an HTTP request was found, 0 if an error occoured
main.c
#include <chl/chl.h>
#include <chl/fcgi.h>
int main() {
// Wait for a request
while(chl_fcgi_next()) {
// Respond to request
chl_set_default_headers();
chl_print_headers();
printf("Hello requester!");
}
}