+ {
+ const char *v;
+ v = z_HTTP_header_lookup(hreq->headers, "Cookie");
+ if (v)
+ setenv("HTTP_COOKIE", v, 1);
+ v = z_HTTP_header_lookup(hreq->headers, "User-Agent");
+ if (v)
+ setenv("HTTP_USER_AGENT", v, 1);
+ v = z_HTTP_header_lookup(hreq->headers, "Accept");
+ if (v)
+ setenv("HTTP_ACCEPT", v, 1);
+ v = z_HTTP_header_lookup(hreq->headers, "Accept-Encoding");
+ if (v)
+ setenv("HTTP_ACCEPT_ENCODING", v, 1);
+ std::map<std::string,std::string>::const_iterator it;
+ for (it = m_p->env_map.begin();
+ it != m_p->env_map.end(); it++)
+ setenv(it->first.c_str(), it->second.c_str(), 1);
+ char *program = xstrdup(program_cstr);
+ char *cp = strrchr(program, '/');
+ if (cp)
+ {
+ *cp++ = '\0';
+ chdir(program);
+ }
+ else
+ cp = program;
+ r = execl(cp, cp, (char *) 0);
+ }