|
|
| version 1.26, 2001/04/15 13:12:17 | version 1.28, 2001/04/17 19:31:06 |
|---|---|
| Line 102 static void append_env_pair(const Hash:: | Line 102 static void append_env_pair(const Hash:: |
| Hash& hash=*static_cast<Hash *>(info); | Hash& hash=*static_cast<Hash *>(info); |
| hash.put(key, &static_cast<Value *>(value)->as_string()); | hash.put(key, &static_cast<Value *>(value)->as_string()); |
| } | } |
| /// ^exec[file-name] | /** |
| /// ^exec[file-name;env hash] | ^exec[file-name] |
| /// ^exec[file-name;env hash;cmd;line;arg;s] | ^exec[file-name;env hash] |
| /// @test header to $fields. waits for header '\' tricks | ^exec[file-name;env hash;cmd;line;arg;s] |
| @test header to $fields. waits for header '\' tricks | |
| @todo fix `` in perl - they produced flipping consoles and no output to perl | |
| */ | |
| static void _cgi(Request& r, const String& method_name, MethodParams *params) { | static void _cgi(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| Line 152 static void _cgi(Request& r, const Strin | Line 155 static void _cgi(Request& r, const Strin |
| PASS(REMOTE_USER); | PASS(REMOTE_USER); |
| // SCRIPT_NAME | // SCRIPT_NAME |
| env.put(String(pool, "SCRIPT_NAME"), &script_name); | env.put(String(pool, "SCRIPT_NAME"), &script_name); |
| #ifdef WIN32 | |
| // WIN32 shell | |
| PASS(COMSPEC); | |
| #endif | |
| if(params->size()>1) { | if(params->size()>1) { |
| Value& venv=params->get_no_junction(1, "env must not be code"); | Value& venv=params->get_no_junction(1, "env must not be code"); |
| Line 172 static void _cgi(Request& r, const Strin | Line 179 static void _cgi(Request& r, const Strin |
| const String in(pool, r.post_data, r.post_size); | const String in(pool, r.post_data, r.post_size); |
| String out(pool); | String out(pool); |
| String err(pool); | String& err=*new(pool) String(pool); |
| int exit_code=pa_exec(script_name, &env, argv, | int exit_code=pa_exec(script_name, &env, argv, |
| in, out, err); | in, out, err); |
| Line 186 static void _cgi(Request& r, const Strin | Line 193 static void _cgi(Request& r, const Strin |
| delim_size=0; // calm down, compiler | delim_size=0; // calm down, compiler |
| PTHROW(0, 0, | PTHROW(0, 0, |
| &method_name, | &method_name, |
| "output does not contain CGI header"); | "output does not contain CGI header; exit code=%d; size=%u; text: \"%s\"", |
| exit_code, (uint)out.size(), out.cstr()); | |
| } | } |
| const String& header=out.mid(0, pos); | const String& header=out.mid(0, pos); |