3 void handle_connection(int s) {
8 if (!fgets(line_in, 100, stdin)) return;
9 char *p = line_in + strlen("GET /");
12 printf("HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=utf-8\r\n\r\n<!--");
14 char *spaaaace = malloc(1024*64);
15 memset(spaaaace, ' ', 1024*64);
18 time_t t = round_up(real_seconds(), 4);
20 if (*p != '0' && *p != '1') return;
23 if (fwrite(spaaaace, 1024, 64, stdout) <= 0) return;
24 t += (*p == '1') ? 2 : 4;
30 int s = netopen_server(NULL, "4422", JH_TCP_HINTS);
32 int s_ = accept(s, NULL, NULL);
35 handle_connection(s_);