Skip to content
it4e edited this page Oct 4, 2016 · 2 revisions

Name

<chl/chl.h>

chl_fcgi_next, CHL FastCGI next

Declaration

char chl_fcgi_next();

Description

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.

Arguments

No arguments.

Return value

1 if an HTTP request was found, 0 if an error occoured


Examples

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!");
    }
}

As CHL is open-source, people are able to contribute with their own APIs, plugins and code which means that CHL is constantly upgraded and provided with new features. Do you have an idea for a new CHL feature and want to contribute?

See contribute.

Setup. API. Tutorial. Examples. FastCGI.

Clone this wiki locally