gemquote output
[gemrepl.git] / gemscgi.h
blob61e7db7bd1342af3b9be86e31dd574c08f1ed6a5
1 #include <stddef.h>
3 typedef struct Request_Info {
4 const char *query_string_decoded;
5 const char *script_path;
6 const char *path_info;
7 const char *server_name;
8 const char *server_port;
9 const char *remote_addr;
10 const char *tls_client_hash;
11 const char *tls_client_issuer;
12 const char *tls_client_issuer_cn;
13 const char *tls_client_subject;
14 const char *tls_client_subject_cn;
15 } Request_Info;
17 typedef void write_response_cb(const void *object, const char* buf, size_t n);
18 typedef void respond_cb(void *object, const Request_Info *request_info,
19 int socket);
21 /* Create a socket at `socket_path` and accept valid SCGI requests with empty
22 * body; for each such, `respond` will be called with `respond_object` and a
23 * `Request_Info` struct filled in according to the request headers. This
24 * should write its response to `socket`. */
25 void runSCGI(const char *socket_path, respond_cb respond, void *respond_object);