Lines Matching +full:- +full:outfile
2 * nghttp2 - HTTP/2 C Library
132 FILE *outfile = stdout; variable
135 void set_output(FILE *file) { outfile = file; } in set_output()
138 void print_frame_attr_indent() { fprintf(outfile, " "); } in print_frame_attr_indent()
151 fprintf(outfile, "%s%s%s: %s\n", ansi_esc("\033[1;34m"), nv->name, in print_nv()
152 ansi_escend(), nv->value); in print_nv()
168 fprintf(outfile, "%s[%3ld.%03ld]%s", ansi_esc("\033[33m"), in print_timer()
175 fprintf(outfile, "<length=%zu, flags=0x%02x, stream_id=%d>\n", hd.length, in print_frame_hd()
243 fprintf(outfile, "; %s\n", s.c_str()); in print_flags()
257 fprintf(outfile, "%s%s%s frame ", frame_name_ansi_esc(ptype), in print_frame()
258 strframetype(frame->hd.type).c_str(), ansi_escend()); in print_frame()
259 print_frame_hd(frame->hd); in print_frame()
260 if (frame->hd.flags) { in print_frame()
262 print_flags(frame->hd); in print_frame()
264 switch (frame->hd.type) { in print_frame()
266 if (frame->data.padlen > 0) { in print_frame()
268 fprintf(outfile, "(padlen=%zu)\n", frame->data.padlen); in print_frame()
273 fprintf(outfile, "(padlen=%zu", frame->headers.padlen); in print_frame()
274 if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) { in print_frame()
275 fprintf(outfile, ", dep_stream_id=%d, weight=%u, exclusive=%d", in print_frame()
276 frame->headers.pri_spec.stream_id, frame->headers.pri_spec.weight, in print_frame()
277 frame->headers.pri_spec.exclusive); in print_frame()
279 fprintf(outfile, ")\n"); in print_frame()
280 switch (frame->headers.cat) { in print_frame()
283 fprintf(outfile, "; Open new stream\n"); in print_frame()
287 fprintf(outfile, "; First response header\n"); in print_frame()
291 fprintf(outfile, "; First push response header\n"); in print_frame()
296 print_nv(frame->headers.nva, frame->headers.nvlen); in print_frame()
301 fprintf(outfile, "(dep_stream_id=%d, weight=%u, exclusive=%d)\n", in print_frame()
302 frame->priority.pri_spec.stream_id, frame->priority.pri_spec.weight, in print_frame()
303 frame->priority.pri_spec.exclusive); in print_frame()
308 fprintf(outfile, "(error_code=%s(0x%02x))\n", in print_frame()
309 nghttp2_http2_strerror(frame->rst_stream.error_code), in print_frame()
310 frame->rst_stream.error_code); in print_frame()
314 fprintf(outfile, "(niv=%lu)\n", in print_frame()
315 static_cast<unsigned long>(frame->settings.niv)); in print_frame()
316 for (size_t i = 0; i < frame->settings.niv; ++i) { in print_frame()
318 fprintf(outfile, "[%s(0x%02x):%u]\n", in print_frame()
319 strsettingsid(frame->settings.iv[i].settings_id), in print_frame()
320 frame->settings.iv[i].settings_id, frame->settings.iv[i].value); in print_frame()
325 fprintf(outfile, "(padlen=%zu, promised_stream_id=%d)\n", in print_frame()
326 frame->push_promise.padlen, frame->push_promise.promised_stream_id); in print_frame()
327 print_nv(frame->push_promise.nva, frame->push_promise.nvlen); in print_frame()
331 fprintf(outfile, "(opaque_data=%s)\n", in print_frame()
332 util::format_hex(frame->ping.opaque_data).c_str()); in print_frame()
337 outfile, in print_frame()
340 frame->goaway.last_stream_id, in print_frame()
341 nghttp2_http2_strerror(frame->goaway.error_code), in print_frame()
342 frame->goaway.error_code, in print_frame()
343 static_cast<unsigned int>(frame->goaway.opaque_data_len), in print_frame()
344 util::ascii_dump(frame->goaway.opaque_data, frame->goaway.opaque_data_len) in print_frame()
349 fprintf(outfile, "(window_size_increment=%d)\n", in print_frame()
350 frame->window_update.window_size_increment); in print_frame()
353 auto altsvc = static_cast<nghttp2_ext_altsvc *>(frame->ext.payload); in print_frame()
355 fprintf(outfile, "(origin=[%.*s], altsvc_field_value=[%.*s])\n", in print_frame()
356 static_cast<int>(altsvc->origin_len), altsvc->origin, in print_frame()
357 static_cast<int>(altsvc->field_value_len), altsvc->field_value); in print_frame()
361 auto origin = static_cast<nghttp2_ext_origin *>(frame->ext.payload); in print_frame()
362 for (size_t i = 0; i < origin->nov; ++i) { in print_frame()
363 auto ent = &origin->ov[i]; in print_frame()
365 fprintf(outfile, "[%.*s]\n", (int)ent->origin_len, ent->origin); in print_frame()
371 static_cast<nghttp2_ext_priority_update *>(frame->ext.payload); in print_frame()
373 fprintf(outfile, in print_frame()
375 priority_update->stream_id, in print_frame()
376 static_cast<int>(priority_update->field_value_len), in print_frame()
377 priority_update->field_value); in print_frame()
395 fprintf(outfile, " recv (stream_id=%d", frame->hd.stream_id); in verbose_on_header_callback()
397 fprintf(outfile, ", sensitive"); in verbose_on_header_callback()
399 fprintf(outfile, ") "); in verbose_on_header_callback()
402 fflush(outfile); in verbose_on_header_callback()
411 fprintf(outfile, " recv "); in verbose_on_frame_recv_callback()
413 fflush(outfile); in verbose_on_frame_recv_callback()
422 fprintf(outfile, " [INVALID; error=%s] recv ", in verbose_on_invalid_frame_recv_callback()
425 fflush(outfile); in verbose_on_invalid_frame_recv_callback()
433 fprintf(outfile, " send "); in verbose_on_frame_send_callback()
435 fflush(outfile); in verbose_on_frame_send_callback()
447 fprintf(outfile, in verbose_on_data_chunk_recv_callback()
450 fflush(outfile); in verbose_on_data_chunk_recv_callback()
458 fprintf(outfile, " [ERROR] %.*s\n", (int)len, msg); in verbose_error_callback()
459 fflush(outfile); in verbose_error_callback()