Commit a8e4da80 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

deflatehd: Fix wire is not written if length is 0

parent 6540ac1b
......@@ -90,7 +90,11 @@ static void output_to_json(nghttp2_hd_context *deflater,
json_object_set_new(obj, "percentage_of_original_size",
json_real((double)len / inputlen * 100));
to_hex(hex, buf, len);
json_object_set_new(obj, "wire", json_pack("s#", hex, len * 2));
if(len == 0) {
json_object_set_new(obj, "wire", json_string(""));
} else {
json_object_set_new(obj, "wire", json_pack("s#", hex, len * 2));
}
json_object_set_new(obj, "headers", dump_headers(nva, nvlen));
json_object_set_new(obj, "header_table_size",
json_integer(config.table_size));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment