don't munge "=> ?!"
[gemrepl.git] / gemscgi_example.c
blob475a87de648f8a09dbb7bd2cf99d349461635270
1 #include <string.h>
2 #include <unistd.h>
4 #include "gemscgi.h"
6 void respond(void *object, const Request_Info *request_info, int socket)
8 #define put(s) write(socket, s, strlen(s))
9 put("20\r\n");
10 if (request_info->query_string_decoded != NULL) {
11 put(request_info->query_string_decoded);
12 put("\r\n");
14 if (request_info->path_info != NULL) {
15 put(request_info->path_info);
16 put("\r\n");
18 if (request_info->script_path != NULL) {
19 put(request_info->script_path);
20 put("\r\n");
22 if (request_info->tls_client_hash != NULL) {
23 put(request_info->tls_client_hash);
24 put("\r\n");
28 int main(int argc, const char **argv)
30 runSCGI("/tmp/gemscgi_testsocket", respond, NULL);