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

Function request_var_fn

server/util_expr_eval.c:1387–1479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1385};
1386
1387static const char *request_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
1388{
1389 int index = ((const char **)data - request_var_names);
1390 request_rec *r = ctx->r;
1391 if (!r)
1392 return "";
1393
1394 switch (index) {
1395 case 0:
1396 return r->method;
1397 case 1:
1398 return ap_http_scheme(r);
1399 case 2:
1400 return r->uri;
1401 case 3:
1402 return r->filename;
1403 case 4:
1404 return ap_get_useragent_host(r, REMOTE_NAME, NULL);
1405 case 5:
1406 return ap_get_remote_logname(r);
1407 case 6:
1408 return r->user;
1409 case 7:
1410 return r->server->server_admin;
1411 case 8:
1412 return ap_get_server_name_for_url(r);
1413 case 9:
1414 return apr_psprintf(ctx->p, "%u", ap_get_server_port(r));
1415 case 10:
1416 return r->protocol;
1417 case 11:
1418 return r->filename;
1419 case 12:
1420 return r->path_info;
1421 case 13:
1422 return r->args;
1423 case 14:
1424 return (r->main != NULL ? "true" : "false");
1425 case 15:
1426 return ap_document_root(r);
1427 case 16:
1428 return r->ap_auth_type;
1429 case 17:
1430 return r->the_request;
1431 case 18:
1432 return r->content_type;
1433 case 19:
1434 return r->handler;
1435 case 20:
1436 return r->log_id;
1437 case 21:
1438 {
1439 char *result = "";
1440 if (r->finfo.valid & APR_FINFO_USER)
1441 apr_uid_name_get(&result, r->finfo.user, ctx->p);
1442 return result;
1443 }
1444 case 22:

Callers

nothing calls this directly

Calls 7

ap_get_useragent_hostFunction · 0.85
ap_get_remote_lognameFunction · 0.85
ap_get_server_portFunction · 0.85
ap_document_rootFunction · 0.85
ap_context_prefixFunction · 0.85
ap_context_document_rootFunction · 0.85

Tested by

no test coverage detected