MCPcopy Create free account
hub / github.com/apache/httpd / isapi_handler

Function isapi_handler

modules/arch/win32/mod_isapi.c:1407–1677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1405 **********************************************************/
1406
1407static apr_status_t isapi_handler (request_rec *r)
1408{
1409 isapi_dir_conf *dconf;
1410 apr_table_t *e;
1411 apr_status_t rv;
1412 isapi_loaded *isa;
1413 isapi_cid *cid;
1414 const char *val;
1415 apr_uint32_t read;
1416 int res;
1417
1418 if (strcmp(r->handler, "isapi-isa")
1419 && strcmp(r->handler, "isapi-handler")) {
1420 /* Hang on to the isapi-isa for compatibility with older docs
1421 * (wtf did '-isa' mean in the first place?) but introduce
1422 * a newer and clearer "isapi-handler" name.
1423 */
1424 return DECLINED;
1425 }
1426 dconf = ap_get_module_config(r->per_dir_config, &isapi_module);
1427 e = r->subprocess_env;
1428
1429 /* Use similar restrictions as CGIs
1430 *
1431 * If this fails, it's pointless to load the isapi dll.
1432 */
1433 if (!(ap_allow_options(r) & OPT_EXECCGI)) {
1434 return HTTP_FORBIDDEN;
1435 }
1436 if (r->finfo.filetype == APR_NOFILE) {
1437 return HTTP_NOT_FOUND;
1438 }
1439 if (r->finfo.filetype != APR_REG) {
1440 return HTTP_FORBIDDEN;
1441 }
1442 if ((r->used_path_info == AP_REQ_REJECT_PATH_INFO) &&
1443 r->path_info && *r->path_info) {
1444 /* default to accept */
1445 return HTTP_NOT_FOUND;
1446 }
1447
1448 if (isapi_lookup(r->pool, r->server, r, r->filename, &isa)
1449 != APR_SUCCESS) {
1450 return HTTP_INTERNAL_SERVER_ERROR;
1451 }
1452 /* Set up variables */
1453 ap_add_common_vars(r);
1454 ap_add_cgi_vars(r);
1455 apr_table_setn(e, "UNMAPPED_REMOTE_USER", "REMOTE_USER");
1456 if ((val = apr_table_get(e, "HTTPS")) && (strcmp(val, "on") == 0))
1457 apr_table_setn(e, "SERVER_PORT_SECURE", "1");
1458 else
1459 apr_table_setn(e, "SERVER_PORT_SECURE", "0");
1460 apr_table_setn(e, "URL", r->uri);
1461
1462 /* Set up connection structure and ecb,
1463 * NULL or zero out most fields.
1464 */

Callers

nothing calls this directly

Calls 9

ap_get_module_configFunction · 0.85
ap_allow_optionsFunction · 0.85
isapi_lookupFunction · 0.85
ap_add_common_varsFunction · 0.85
ap_add_cgi_varsFunction · 0.85
ap_setup_client_blockFunction · 0.85
ap_should_client_blockFunction · 0.85
ap_get_client_blockFunction · 0.85
ap_pass_brigadeFunction · 0.85

Tested by

no test coverage detected