return DECLINED;
}
-#define bbout(...) apr_brigade_printf(bb, NULL, NULL, __VA_ARGS__)
+static apr_status_t bbout(apr_bucket_brigade *bb, const char *fmt, ...)
+{
+ va_list args;
+ apr_status_t rv;
+
+ va_start(args, fmt);
+ rv = apr_brigade_vprintf(bb, NULL, NULL, fmt, args);
+ va_end(args);
+
+ return rv;
+}
+
static apr_status_t h2_sos_h2_status_buffer(h2_sos *sos, apr_bucket_brigade *bb)
{
h2_stream *stream = sos->stream;
bb = apr_brigade_create(stream->pool, session->c->bucket_alloc);
}
- bbout("{\n");
- bbout(" \"HTTP2\": \"on\",\n");
- bbout(" \"H2PUSH\": \"%s\",\n", h2_session_push_enabled(session)? "on" : "off");
- bbout(" \"mod_http2_version\": \"%s\",\n", MOD_HTTP2_VERSION);
- bbout(" \"session_id\": %ld,\n", (long)session->id);
- bbout(" \"streams_max\": %d,\n", (int)session->max_stream_count);
- bbout(" \"this_stream\": %d,\n", stream->id);
- bbout(" \"streams_open\": %d,\n", (int)h2_ihash_count(session->streams));
- bbout(" \"max_stream_started\": %d,\n", mplx->max_stream_started);
- bbout(" \"requests_received\": %d,\n", session->remote.emitted_count);
- bbout(" \"responses_submitted\": %d,\n", session->responses_submitted);
- bbout(" \"streams_reset\": %d, \n", session->streams_reset);
- bbout(" \"pushes_promised\": %d,\n", session->pushes_promised);
- bbout(" \"pushes_submitted\": %d,\n", session->pushes_submitted);
- bbout(" \"pushes_reset\": %d,\n", session->pushes_reset);
+ bbout(bb, "{\n");
+ bbout(bb, " \"HTTP2\": \"on\",\n");
+ bbout(bb, " \"H2PUSH\": \"%s\",\n", h2_session_push_enabled(session)? "on" : "off");
+ bbout(bb, " \"mod_http2_version\": \"%s\",\n", MOD_HTTP2_VERSION);
+ bbout(bb, " \"session_id\": %ld,\n", (long)session->id);
+ bbout(bb, " \"streams_max\": %d,\n", (int)session->max_stream_count);
+ bbout(bb, " \"this_stream\": %d,\n", stream->id);
+ bbout(bb, " \"streams_open\": %d,\n", (int)h2_ihash_count(session->streams));
+ bbout(bb, " \"max_stream_started\": %d,\n", mplx->max_stream_started);
+ bbout(bb, " \"requests_received\": %d,\n", session->remote.emitted_count);
+ bbout(bb, " \"responses_submitted\": %d,\n", session->responses_submitted);
+ bbout(bb, " \"streams_reset\": %d, \n", session->streams_reset);
+ bbout(bb, " \"pushes_promised\": %d,\n", session->pushes_promised);
+ bbout(bb, " \"pushes_submitted\": %d,\n", session->pushes_submitted);
+ bbout(bb, " \"pushes_reset\": %d,\n", session->pushes_reset);
diary = session->push_diary;
if (diary) {
stream->request->authority, &data, &len);
if (status == APR_SUCCESS) {
base64_digest = h2_util_base64url_encode(data, len, stream->pool);
- bbout(" \"cache_digest\": \"%s\",\n", base64_digest);
+ bbout(bb, " \"cache_digest\": \"%s\",\n", base64_digest);
}
/* try the reverse for testing purposes */
stream->request->authority, &data, &len);
if (status == APR_SUCCESS) {
base64_digest = h2_util_base64url_encode(data, len, stream->pool);
- bbout(" \"cache_digest^2\": \"%s\",\n", base64_digest);
+ bbout(bb, " \"cache_digest^2\": \"%s\",\n", base64_digest);
}
}
}
- bbout(" \"frames_received\": %ld,\n", (long)session->frames_received);
- bbout(" \"frames_sent\": %ld,\n", (long)session->frames_sent);
- bbout(" \"bytes_received\": %"APR_UINT64_T_FMT",\n", session->io.bytes_read);
- bbout(" \"bytes_sent\": %"APR_UINT64_T_FMT"\n", session->io.bytes_written);
- bbout("}\n");
+ bbout(bb, " \"frames_received\": %ld,\n", (long)session->frames_received);
+ bbout(bb, " \"frames_sent\": %ld,\n", (long)session->frames_sent);
+ bbout(bb, " \"bytes_received\": %"APR_UINT64_T_FMT",\n", session->io.bytes_read);
+ bbout(bb, " \"bytes_sent\": %"APR_UINT64_T_FMT"\n", session->io.bytes_written);
+ bbout(bb, "}\n");
return sos->prev->buffer(sos->prev, bb);
}