From ce53d7bd9edab56d00e5f20ec9e019e0c947acf1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 9 Feb 2014 21:34:28 +0900 Subject: [PATCH] src: Don't output priority if NGHTTP2_FLAG_PRIORITY is not set --- src/app_helper.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app_helper.cc b/src/app_helper.cc index 059bde55..e4620bee 100644 --- a/src/app_helper.cc +++ b/src/app_helper.cc @@ -331,8 +331,11 @@ void print_frame(print_type ptype, const nghttp2_frame *frame) break; case NGHTTP2_HEADERS: print_frame_attr_indent(); - fprintf(outfile, "(pri=%d, padlen=%zu)\n", - frame->headers.pri, frame->headers.padlen); + fprintf(outfile, "("); + if(frame->hd.flags & NGHTTP2_FLAG_PRIORITY) { + fprintf(outfile, "pri=%d, ", frame->headers.pri); + } + fprintf(outfile, "padlen=%zu)\n", frame->headers.padlen); switch(frame->headers.cat) { case NGHTTP2_HCAT_REQUEST: print_frame_attr_indent();