| 191 | } |
| 192 | |
| 193 | void http_cgi_thread(void *ctx) |
| 194 | { |
| 195 | CGI *cgi = (CGI*) ctx; |
| 196 | HTTP_HDR_REQ *hdr_req = cgi->hdr_req; |
| 197 | ACL_ARGV *env = acl_argv_alloc(10); |
| 198 | ACL_ITER iter; |
| 199 | |
| 200 | const char *reply = "HTTP/1.1 200 OK\r\n" |
| 201 | "Date: Sun, 15 Nov 2009 07:06:22 GMT\r\n" |
| 202 | "Server: Apache/2.2.9 (Unix)\r\n" |
| 203 | "Connection: close\r\n" |
| 204 | "Content-Type: text/html\r\n\r\n"; |
| 205 | acl_foreach(iter, hdr_req->hdr.entry_lnk) { |
| 206 | HTTP_HDR_ENTRY *entry = (HTTP_HDR_ENTRY*) iter.data; |
| 207 | |
| 208 | if (entry->off) |
| 209 | continue; |
| 210 | acl_argv_add(env, entry->name, entry->value, NULL); |
| 211 | } |
| 212 | |
| 213 | if (1) |
| 214 | run_cgi(cgi, env); |
| 215 | else { |
| 216 | acl_vstream_writen(cgi->client, reply, sizeof(reply)); |
| 217 | } |
| 218 | acl_argv_free(env); |
| 219 | cgi_free(cgi); |
| 220 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…