I would like to expose some HTTP/2 properties, for example "HTTP2=on|off"
similar to what mod_ssl does with HTTPS and other SSL variables. Current
implementation does not look like something to repeat, at first glance, but
maybe it's the only way...
The optional function ssl_is_https is used:
- from many modules
- server/util_expr_eval.c
The optional function ssl_var_lookup is used:
- from even more modules
- *not* in server
Subprocesses get their environment via r->subprocess_env, filled via the
"fixups" hook. This is the usual way how we involve modules in request
processing. But, as I read it, subprocess_env gets filled with all variables
for every request, even though they maybe never read? Hmm, probably a little
late to do anything about that without code breakage.
So, the least work and most 2.4.x compatible way for mod_http2 is to mimmic the
mod_ssl way. http2_is_http2() and http2_var_lookup(), optional. Add fixups hook
for subprocess_env, add $HTTP2 handling to server/util_expr_eval.c for checks
in config/htaccess?
//Stefan
PS. For trunk, it might be a nice TODO to add a variable registry that allows
lazy evaluation. Like with
struct ap_var_handler_t {
const char *name;
const char *lookup(struct ap_var_handler_t *h, server_rec *s, conn_rec *c,
request_rec *r);
void *ctx;
int server_specific :1;
int conn_specific :1;
int cacheable :1;
int scope_config :1;
int scope_subprocess :1;
}