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

Function misc_var_fn

server/util_expr_eval.c:1536–1572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1534};
1535
1536static const char *misc_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
1537{
1538 apr_time_exp_t tm;
1539 int index = ((const char **)data - misc_var_names);
1540 apr_time_exp_lt(&tm, apr_time_now());
1541
1542 switch (index) {
1543 case 0:
1544 return apr_psprintf(ctx->p, "%02d%02d", (tm.tm_year / 100) + 19,
1545 tm.tm_year % 100);
1546 case 1:
1547 return apr_psprintf(ctx->p, "%02d", tm.tm_mon+1);
1548 case 2:
1549 return apr_psprintf(ctx->p, "%02d", tm.tm_mday);
1550 case 3:
1551 return apr_psprintf(ctx->p, "%02d", tm.tm_hour);
1552 case 4:
1553 return apr_psprintf(ctx->p, "%02d", tm.tm_min);
1554 case 5:
1555 return apr_psprintf(ctx->p, "%02d", tm.tm_sec);
1556 case 6:
1557 return apr_psprintf(ctx->p, "%d", tm.tm_wday);
1558 case 7:
1559 return apr_psprintf(ctx->p, "%02d%02d%02d%02d%02d%02d%02d",
1560 (tm.tm_year / 100) + 19, (tm.tm_year % 100),
1561 tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min,
1562 tm.tm_sec);
1563 case 8:
1564 return ap_get_server_banner();
1565 case 9:
1566 return apr_itoa(ctx->p, MODULE_MAGIC_NUMBER_MAJOR);
1567 default:
1568 ap_assert(0);
1569 }
1570
1571 return NULL;
1572}
1573
1574static int subnet_parse_arg(ap_expr_lookup_parms *parms)
1575{

Callers

nothing calls this directly

Calls 1

ap_get_server_bannerFunction · 0.85

Tested by

no test coverage detected