|
|
| version 1.73, 2002/06/11 14:14:16 | version 1.76, 2002/06/24 11:59:33 |
|---|---|
| Line 376 void real_parser_handler(Pool& pool, LPE | Line 376 void real_parser_handler(Pool& pool, LPE |
| request_info.content_type=lpECB->lpszContentType; | request_info.content_type=lpECB->lpszContentType; |
| request_info.content_length=lpECB->cbTotalBytes; | request_info.content_length=lpECB->cbTotalBytes; |
| request_info.cookie=SAPI::get_env(pool, "HTTP_COOKIE"); | request_info.cookie=SAPI::get_env(pool, "HTTP_COOKIE"); |
| request_info.mail_received=false; | |
| // prepare to process request | // prepare to process request |
| Request request(pool, | Request request(pool, |
| Line 389 void real_parser_handler(Pool& pool, LPE | Line 389 void real_parser_handler(Pool& pool, LPE |
| #endif | #endif |
| /* status_allowed */); | /* status_allowed */); |
| // some root-controlled location | |
| // c:\windows | |
| char root_config_path[MAX_STRING]; | |
| GetWindowsDirectory(root_config_path, MAX_STRING); | |
| // must be dynamic: rethrowing from request.core | |
| // may return 'source' which can be inside of 'root auto.p@exeception' | |
| char *root_config_filespec=(char *)pool.malloc(MAX_STRING); | |
| snprintf(root_config_filespec, MAX_STRING, | |
| "%s/%s", | |
| root_config_path, CONFIG_FILE_NAME); | |
| // beside by binary | // beside by binary |
| static char site_config_path[MAX_STRING]; | static char beside_binary_path[MAX_STRING]; |
| strncpy(site_config_path, argv0, MAX_STRING-1); site_config_path[MAX_STRING-1]=0; // filespec of my binary | strncpy(beside_binary_path, argv0, MAX_STRING-1); beside_binary_path[MAX_STRING-1]=0; // filespec of my binary |
| if(!( | if(!( |
| rsplit(site_config_path, '/') || | rsplit(beside_binary_path, '/') || |
| rsplit(site_config_path, '\\'))) { // strip filename | rsplit(beside_binary_path, '\\'))) { // strip filename |
| // no path, just filename | // no path, just filename |
| site_config_path[0]='.'; site_config_path[1]=0; | beside_binary_path[0]='.'; beside_binary_path[1]=0; |
| } | } |
| char site_config_filespec[MAX_STRING]; | char config_filespec[MAX_STRING]; |
| snprintf(site_config_filespec, MAX_STRING, | snprintf(config_filespec, MAX_STRING, |
| "%s/%s", | "%s/%s", |
| site_config_path, CONFIG_FILE_NAME); | beside_binary_path, AUTO_FILE_NAME); |
| // process the request | // process the request |
| request.core( | request.core( |
| root_config_filespec, false /*fail_on_read_problem*/, // /path/to/root/parser3.conf | config_filespec, false /*fail_on_read_problem*/, // /path/to/first/auto.p |
| site_config_filespec, false /*fail_on_read_problem*/, // /path/to/site/parser3.conf | |
| header_only); | header_only); |
| } | } |