Keep processing files in QPACK offline decoder after encountering failure. There are two different kinds of issues with the interop encodings checked in to https://github.com/qpackers/qifs. For debugging I find it helpful if I can invoke qpack_offline_decoder once with a very long argument list and it keeps processing files even if many of them fail. gfe-relnote: n/a, change to QUIC v99-only code. Protected by existing disabled gfe2_reloadable_flag_quic_enable_version_99. PiperOrigin-RevId: 268770474 Change-Id: Ia2a36cd10ebbd7c2d3b87bb62c42a09aec709c02
diff --git a/quic/core/qpack/offline/qpack_offline_decoder_bin.cc b/quic/core/qpack/offline/qpack_offline_decoder_bin.cc index a4f5373..d72b000 100644 --- a/quic/core/qpack/offline/qpack_offline_decoder_bin.cc +++ b/quic/core/qpack/offline/qpack_offline_decoder_bin.cc
@@ -24,6 +24,7 @@ } size_t i; + size_t success_count = 0; for (i = 0; 2 * i < args.size(); ++i) { const quic::QuicStringPiece input_filename(args[2 * i]); const quic::QuicStringPiece expected_headers_filename(args[2 * i + 1]); @@ -31,14 +32,15 @@ // Every file represents a different connection, // therefore every file needs a fresh decoding context. quic::QpackOfflineDecoder decoder; - if (!decoder.DecodeAndVerifyOfflineData(input_filename, - expected_headers_filename)) { - return 1; + if (decoder.DecodeAndVerifyOfflineData(input_filename, + expected_headers_filename)) { + ++success_count; } } - std::cout << "Successfully verified " << i << " pairs of input files." - << std::endl; + std::cout << "Processed " << i << " pairs of input files, " << success_count + << " passed, " << (i - success_count) << " failed." << std::endl; - return 0; + // Return success if all input files pass. + return (success_count == i) ? 0 : 1; }