processing, better compatibility */
int hack_mpm_event; /* If mpm_event is detected, perform a hack
on stream connections to make it work */
- int h2_direct; /* if mod_h2 is active on non-TLS directly */
+ int h2_direct; /* if mod_h2 is active directly */
int buffer_output; /* if output buffering shall be used */
int buffer_size; /* size of buffer for outgoing data */
int write_max; /* max number of bytes for a write op */
if (h2_ctx_pnego_is_ongoing(ctx)) {
temp = apr_brigade_create(c->pool, c->bucket_alloc);
ap_get_brigade(c->input_filters, temp,
- AP_MODE_SPECULATIVE, APR_BLOCK_READ, 1);
+ AP_MODE_SPECULATIVE, APR_BLOCK_READ, 24);
apr_brigade_destroy(temp);
}
apr_status_t status;
temp = apr_brigade_create(c->pool, c->bucket_alloc);
status = ap_get_brigade(c->input_filters, temp,
- AP_MODE_SPECULATIVE, APR_BLOCK_READ, 24);
+ /*h2_h2_is_tls(c)? AP_MODE_READBYTES :*/ AP_MODE_SPECULATIVE, APR_BLOCK_READ, 24);
if (status == APR_SUCCESS) {
char *s = NULL;
apr_size_t slen;
apr_brigade_pflatten(temp, &s, &slen, c->pool);
- if ((slen == 24) && !memcmp(H2_MAGIC_TOKEN, s, 24)) {
+ if ((slen >= 24) && !memcmp(H2_MAGIC_TOKEN, s, 24)) {
+ ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c,
+ "h2_h2, direct mode detected");
h2_ctx_pnego_set_done(ctx, "h2");
}
+ else {
+ ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c,
+ "h2_h2, not detected, seeing %d bytes: %s",
+ (int)slen, s);
+ }
}
apr_brigade_destroy(temp);
}