</usage>
</directivesynopsis>
+ <directivesynopsis>
+ <name>H2EarlyHints</name>
+ <description>Determine sending of 103 status codes</description>
+ <syntax>H2EarlyHints on|off</syntax>
+ <default>H2EarlyHints off</default>
+ <contextlist>
+ <context>server config</context>
+ <context>virtual host</context>
+ </contextlist>
+ <compatibility>Available in version 2.4.24 and later.</compatibility>
+
+ <usage>
+ <p>
+ This setting controls if HTTP status 103 interim responses are
+ forwarded to the client or not. By default, this is currently
+ not the case since a range of clients still have trouble with
+ unexpected interim responses.
+ </p>
+ <p>
+ When set to <code>on</code>, PUSH resources announced with
+ <code>H2PushResource</code> will trigger an interim 103 response
+ before the final response. The 103 response will carry <code>Link</code>
+ headers that advise the <code>preload</code> of such resources.
+ </p>
+ </usage>
+ </directivesynopsis>
+
</modulesynopsis>
NULL, /* map of content-type to priorities */
256, /* push diary size */
0, /* copy files across threads */
- NULL /* push list */
+ NULL, /* push list */
+ 0, /* early hints, http status 103 */
};
void h2_config_init(apr_pool_t *pool)
conf->push_diary_size = DEF_VAL;
conf->copy_files = DEF_VAL;
conf->push_list = NULL;
+ conf->early_hints = DEF_VAL;
return conf;
}
else {
n->push_list = add->push_list? add->push_list : base->push_list;
}
+ n->early_hints = H2_CONFIG_GET(add, base, early_hints);
return n;
}
return H2_CONFIG_GET(conf, &defconf, push_diary_size);
case H2_CONF_COPY_FILES:
return H2_CONFIG_GET(conf, &defconf, copy_files);
+ case H2_CONF_EARLY_HINTS:
+ return H2_CONFIG_GET(conf, &defconf, early_hints);
default:
return DEF_VAL;
}
return NULL;
}
+static const char *h2_conf_set_early_hints(cmd_parms *parms,
+ void *arg, const char *value)
+{
+ h2_config *cfg = (h2_config *)h2_config_sget(parms->server);
+ if (!strcasecmp(value, "On")) {
+ cfg->early_hints = 1;
+ return NULL;
+ }
+ else if (!strcasecmp(value, "Off")) {
+ cfg->early_hints = 0;
+ return NULL;
+ }
+
+ (void)arg;
+ return "value must be On or Off";
+}
+
#define AP_END_CMD AP_INIT_TAKE1(NULL, NULL, NULL, RSRC_CONF, NULL)
const command_rec h2_cmds[] = {
OR_FILEINFO, "on to perform copy of file data"),
AP_INIT_TAKE123("H2PushResource", h2_conf_add_push_res, NULL,
OR_FILEINFO, "add a resource to be pushed in this location/on this server."),
+ AP_INIT_TAKE1("H2EarlyHints", h2_conf_set_early_hints, NULL,
+ RSRC_CONF, "on to enable interim status 103 responses"),
AP_END_CMD
};
apr_itoa(stream->pool, connFlowOut));
}
+ if (headers->status == 103
+ && !h2_config_geti(session->config, H2_CONF_EARLY_HINTS)) {
+ /* suppress sending this to the client, it might have triggered
+ * pushes and served its purpose nevertheless */
+ rv = 0;
+ goto leave;
+ }
+
ngh = h2_util_ngheader_make_res(stream->pool, headers->status, hout);
rv = nghttp2_submit_response(session->ngh2, stream->id,
ngh->nv, ngh->nvlen, pprovider);