MCPcopy Create free account
hub / github.com/acl-dev/acl / http_cgi_thread

Function http_cgi_thread

app/jaws/plugin/cgi/http_cgi.c:193–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void 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}

Callers

nothing calls this directly

Calls 7

acl_argv_allocFunction · 0.85
acl_argv_addFunction · 0.85
run_cgiFunction · 0.85
acl_vstream_writenFunction · 0.85
acl_argv_freeFunction · 0.85
cgi_freeFunction · 0.85
acl_foreachFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…