@fails-components/webtransport 0.0.1-rc.0 → 0.0.1-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/.github/workflows/npm-publish-packages.yml +0 -0
  2. package/CMakeLists.txt +2 -0
  3. package/package.json +1 -1
  4. package/readme.md +0 -0
  5. package/src/http3serversession.h +1 -1
  6. package/src/webtransport.js +4 -2
  7. package/third_party/boringssl/src/CMakeLists.txt +9 -12
  8. package/third_party/boringssl/src/crypto/CMakeLists.txt +2 -3
  9. package/third_party/boringssl/src/crypto/asn1/time_support.c +206 -206
  10. package/third_party/boringssl/src/crypto/bio/socket_helper.c +124 -122
  11. package/third_party/boringssl/src/crypto/evp/digestsign.c +268 -231
  12. package/third_party/boringssl/src/crypto/evp/p_ec.c +286 -286
  13. package/third_party/boringssl/src/crypto/fipsmodule/aes/key_wrap.c +246 -236
  14. package/third_party/boringssl/src/crypto/fipsmodule/aes/mode_wrappers.c +124 -122
  15. package/third_party/boringssl/src/crypto/fipsmodule/bcm.c +3 -0
  16. package/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c +246 -230
  17. package/third_party/boringssl/src/crypto/fipsmodule/bn/internal.h +734 -715
  18. package/third_party/boringssl/src/crypto/fipsmodule/bn/random.c +349 -341
  19. package/third_party/boringssl/src/crypto/fipsmodule/cipher/cipher.c +670 -648
  20. package/third_party/boringssl/src/crypto/fipsmodule/cipher/e_aes.c +1504 -1472
  21. package/third_party/boringssl/src/crypto/{cipher_extra → fipsmodule/cipher}/e_aesccm.c +435 -446
  22. package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cavp_3des_cmac_tests.txt +0 -0
  23. package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cavp_aes128_cmac_tests.txt +0 -0
  24. package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cavp_aes192_cmac_tests.txt +0 -0
  25. package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cavp_aes256_cmac_tests.txt +0 -0
  26. package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cmac.c +318 -278
  27. package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cmac_test.cc +268 -267
  28. package/third_party/boringssl/src/crypto/fipsmodule/dh/dh.c +5 -1
  29. package/third_party/boringssl/src/crypto/fipsmodule/ec/ec.c +11 -17
  30. package/third_party/boringssl/src/crypto/fipsmodule/ec/ec_key.c +15 -4
  31. package/third_party/boringssl/src/crypto/fipsmodule/ec/internal.h +2 -6
  32. package/third_party/boringssl/src/crypto/fipsmodule/ec/p224-64.c +1164 -1180
  33. package/third_party/boringssl/src/crypto/fipsmodule/ec/p256-nistz.c +3 -3
  34. package/third_party/boringssl/src/crypto/fipsmodule/ec/p256-nistz_test.cc +2 -2
  35. package/third_party/boringssl/src/crypto/fipsmodule/ec/p256.c +44 -33
  36. package/third_party/boringssl/src/crypto/fipsmodule/ec/scalar.c +169 -175
  37. package/third_party/boringssl/src/crypto/fipsmodule/ec/simple.c +352 -357
  38. package/third_party/boringssl/src/crypto/fipsmodule/ecdh/ecdh.c +4 -0
  39. package/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c +14 -9
  40. package/third_party/boringssl/src/crypto/fipsmodule/hmac/hmac.c +256 -235
  41. package/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c +204 -202
  42. package/third_party/boringssl/src/crypto/fipsmodule/rsa/padding.c +702 -695
  43. package/third_party/boringssl/src/crypto/fipsmodule/rsa/rsa_impl.c +7 -2
  44. package/third_party/boringssl/src/crypto/fipsmodule/self_check/self_check.c +7 -0
  45. package/third_party/boringssl/src/crypto/fipsmodule/service_indicator/internal.h +89 -0
  46. package/third_party/boringssl/src/crypto/fipsmodule/service_indicator/service_indicator.c +333 -0
  47. package/third_party/boringssl/src/crypto/fipsmodule/service_indicator/service_indicator_test.cc +2410 -0
  48. package/third_party/boringssl/src/crypto/fipsmodule/sha/sha1.c +359 -357
  49. package/third_party/boringssl/src/crypto/fipsmodule/sha/sha256.c +325 -321
  50. package/third_party/boringssl/src/crypto/fipsmodule/sha/sha512.c +510 -508
  51. package/third_party/boringssl/src/crypto/fipsmodule/tls/kdf.c +177 -165
  52. package/third_party/boringssl/src/crypto/internal.h +13 -0
  53. package/third_party/boringssl/src/crypto/trust_token/trust_token_test.cc +884 -884
  54. package/third_party/boringssl/src/crypto/x509/internal.h +0 -2
  55. package/third_party/boringssl/src/crypto/x509/t_crl.c +148 -148
  56. package/third_party/boringssl/src/crypto/x509/t_req.c +249 -250
  57. package/third_party/boringssl/src/crypto/x509/t_x509.c +2 -3
  58. package/third_party/boringssl/src/crypto/x509/x509_req.c +262 -304
  59. package/third_party/boringssl/src/crypto/x509/x509_set.c +250 -240
  60. package/third_party/boringssl/src/crypto/x509/x509_test.cc +466 -4
  61. package/third_party/boringssl/src/crypto/x509/x509cset.c +292 -279
  62. package/third_party/boringssl/src/crypto/x509/x509rset.c +89 -86
  63. package/third_party/boringssl/src/crypto/x509/x_crl.c +37 -125
  64. package/third_party/boringssl/src/crypto/x509/x_req.c +114 -109
  65. package/third_party/boringssl/src/crypto/x509/x_x509.c +394 -394
  66. package/third_party/boringssl/src/crypto/x509v3/v3_akey.c +11 -16
  67. package/third_party/boringssl/src/crypto/x509v3/v3_alt.c +644 -642
  68. package/third_party/boringssl/src/crypto/x509v3/v3_bcons.c +130 -133
  69. package/third_party/boringssl/src/crypto/x509v3/v3_bitst.c +149 -144
  70. package/third_party/boringssl/src/crypto/x509v3/v3_cpols.c +496 -500
  71. package/third_party/boringssl/src/crypto/x509v3/v3_enum.c +105 -106
  72. package/third_party/boringssl/src/crypto/x509v3/v3_ia5.c +126 -121
  73. package/third_party/boringssl/src/crypto/x509v3/v3_info.c +206 -218
  74. package/third_party/boringssl/src/crypto/x509v3/v3_int.c +97 -91
  75. package/third_party/boringssl/src/crypto/x509v3/v3_pci.c +290 -289
  76. package/third_party/boringssl/src/crypto/x509v3/v3_skey.c +161 -156
  77. package/third_party/boringssl/src/crypto/x509v3/v3_utl.c +5 -3
  78. package/third_party/boringssl/src/include/openssl/aead.h +480 -480
  79. package/third_party/boringssl/src/include/openssl/asn1.h +2 -0
  80. package/third_party/boringssl/src/include/openssl/base.h +1 -1
  81. package/third_party/boringssl/src/include/openssl/service_indicator.h +96 -0
  82. package/third_party/boringssl/src/include/openssl/ssl.h +7 -0
  83. package/third_party/boringssl/src/include/openssl/x509.h +11 -33
  84. package/third_party/boringssl/src/include/openssl/x509v3.h +990 -1018
  85. package/third_party/boringssl/src/sources.cmake +4 -4
  86. package/third_party/boringssl/src/ssl/internal.h +10 -0
  87. package/third_party/boringssl/src/ssl/ssl_lib.cc +3081 -3072
  88. package/third_party/boringssl/src/ssl/ssl_test.cc +46 -0
  89. package/third_party/boringssl/src/ssl/tls13_server.cc +4 -6
  90. package/third_party/boringssl/src/util/bot/DEPS +14 -27
  91. package/third_party/boringssl/src/util/bot/UPDATING +3 -9
  92. package/third_party/boringssl/src/util/bot/update_clang.py +172 -172
  93. package/third_party/boringssl/src/util/bot/vs_toolchain.py +3 -3
  94. package/third_party/quiche/.bazelrc +8 -0
  95. package/third_party/quiche/BUILD.bazel +7 -0
  96. package/third_party/quiche/WHITESPACE +3 -1
  97. package/third_party/quiche/WORKSPACE.bazel +87 -0
  98. package/third_party/quiche/build/BUILD.bazel +7 -0
  99. package/third_party/quiche/build/source_list.bzl +1511 -0
  100. package/third_party/quiche/build/source_list.gni +1511 -0
  101. package/third_party/quiche/build/source_list.json +1511 -0
  102. package/third_party/quiche/build/test.bzl +26 -0
  103. package/third_party/quiche/build/zlib.BUILD +25 -0
  104. package/third_party/quiche/quiche/BUILD.bazel +270 -0
  105. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_enums.cc +3 -3
  106. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_enums.h +7 -7
  107. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_frame.cc +39 -18
  108. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_frame.h +11 -10
  109. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_frame_test.cc +67 -63
  110. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_headers.cc +13 -12
  111. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_headers.h +16 -8
  112. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_headers_test.cc +9 -9
  113. package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_visitor_interface.h +4 -4
  114. package/third_party/quiche/quiche/{common/balsa → balsa}/framer_interface.h +3 -3
  115. package/third_party/quiche/quiche/{common/balsa → balsa}/header_api.h +3 -3
  116. package/third_party/quiche/quiche/{common/balsa → balsa}/header_properties.cc +1 -1
  117. package/third_party/quiche/quiche/{common/balsa → balsa}/header_properties.h +3 -3
  118. package/third_party/quiche/quiche/{common/balsa → balsa}/header_properties_test.cc +1 -1
  119. package/third_party/quiche/quiche/{common/balsa → balsa}/http_validation_policy.cc +1 -1
  120. package/third_party/quiche/quiche/{common/balsa → balsa}/http_validation_policy.h +3 -3
  121. package/third_party/quiche/quiche/{common/balsa → balsa}/noop_balsa_visitor.h +4 -4
  122. package/third_party/quiche/quiche/{common/balsa → balsa}/simple_buffer.cc +22 -29
  123. package/third_party/quiche/quiche/{common/balsa → balsa}/simple_buffer.h +18 -16
  124. package/third_party/quiche/quiche/{common/balsa → balsa}/simple_buffer_test.cc +79 -32
  125. package/third_party/quiche/quiche/{common/balsa → balsa}/standard_header_map.cc +1 -1
  126. package/third_party/quiche/quiche/{common/balsa → balsa}/standard_header_map.h +3 -3
  127. package/third_party/quiche/quiche/common/platform/api/quiche_command_line_flags.h +6 -1
  128. package/third_party/quiche/quiche/common/platform/api/quiche_flags.h +8 -0
  129. package/third_party/quiche/quiche/common/platform/api/quiche_logging.h +0 -3
  130. package/third_party/quiche/quiche/common/platform/api/quiche_lower_case_string_test.cc +29 -0
  131. package/third_party/quiche/quiche/common/platform/api/quiche_test.h +5 -7
  132. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quic_flags_impl.h +1 -1
  133. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_bug_tracker_impl.h +3 -2
  134. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_command_line_flags_impl.cc +41 -0
  135. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_command_line_flags_impl.h +33 -0
  136. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_expect_bug_impl.h +15 -0
  137. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_logging_impl.h +84 -50
  138. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_lower_case_string_impl.h +25 -0
  139. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_stack_trace_impl.cc +1 -1
  140. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_test_impl.cc +25 -0
  141. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_test_impl.h +56 -0
  142. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_test_output_impl.h +27 -0
  143. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_thread_impl.h +26 -0
  144. package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_url_utils_impl.cc +1 -0
  145. package/third_party/quiche/quiche/common/quiche_buffer_allocator_test.cc +1 -1
  146. package/third_party/quiche/quiche/common/quiche_mem_slice_storage.h +2 -3
  147. package/third_party/quiche/quiche/common/structured_headers.cc +14 -12
  148. package/third_party/quiche/quiche/http2/adapter/event_forwarder.cc +7 -5
  149. package/third_party/quiche/quiche/http2/adapter/event_forwarder.h +4 -2
  150. package/third_party/quiche/quiche/http2/adapter/event_forwarder_test.cc +14 -9
  151. package/third_party/quiche/quiche/http2/adapter/header_validator.cc +43 -19
  152. package/third_party/quiche/quiche/http2/adapter/header_validator.h +11 -40
  153. package/third_party/quiche/quiche/http2/adapter/header_validator_base.h +69 -0
  154. package/third_party/quiche/quiche/http2/adapter/header_validator_test.cc +73 -1
  155. package/third_party/quiche/quiche/http2/adapter/nghttp2_adapter_test.cc +66 -0
  156. package/third_party/quiche/quiche/http2/adapter/nghttp2_session_test.cc +8 -5
  157. package/third_party/quiche/quiche/http2/adapter/nghttp2_test.cc +1 -1
  158. package/third_party/quiche/quiche/http2/adapter/noop_header_validator.cc +22 -0
  159. package/third_party/quiche/quiche/http2/adapter/noop_header_validator.h +25 -0
  160. package/third_party/quiche/quiche/http2/adapter/noop_header_validator_test.cc +523 -0
  161. package/third_party/quiche/quiche/http2/adapter/oghttp2_adapter_test.cc +186 -5
  162. package/third_party/quiche/quiche/http2/adapter/oghttp2_session.cc +37 -43
  163. package/third_party/quiche/quiche/http2/adapter/oghttp2_session.h +22 -23
  164. package/third_party/quiche/quiche/http2/adapter/test_utils.cc +1 -1
  165. package/third_party/quiche/quiche/http2/adapter/window_manager_test.cc +11 -5
  166. package/third_party/quiche/quiche/http2/core/http2_trace_logging.cc +13 -11
  167. package/third_party/quiche/quiche/http2/core/http2_trace_logging.h +5 -4
  168. package/third_party/quiche/quiche/http2/core/priority_write_scheduler.h +42 -36
  169. package/third_party/quiche/quiche/http2/core/priority_write_scheduler_test.cc +2 -2
  170. package/third_party/quiche/quiche/http2/decoder/decode_buffer_test.cc +9 -9
  171. package/third_party/quiche/quiche/http2/decoder/decode_http2_structures_test.cc +1 -1
  172. package/third_party/quiche/quiche/http2/decoder/http2_frame_decoder_test.cc +14 -14
  173. package/third_party/quiche/quiche/http2/decoder/http2_structure_decoder_test.cc +17 -17
  174. package/third_party/quiche/quiche/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc +1 -1
  175. package/third_party/quiche/quiche/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc +1 -1
  176. package/third_party/quiche/quiche/http2/decoder/payload_decoders/data_payload_decoder_test.cc +2 -2
  177. package/third_party/quiche/quiche/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc +1 -1
  178. package/third_party/quiche/quiche/http2/decoder/payload_decoders/headers_payload_decoder_test.cc +1 -1
  179. package/third_party/quiche/quiche/http2/decoder/payload_decoders/ping_payload_decoder_test.cc +1 -1
  180. package/third_party/quiche/quiche/http2/decoder/payload_decoders/priority_payload_decoder_test.cc +1 -1
  181. package/third_party/quiche/quiche/http2/decoder/payload_decoders/priority_update_payload_decoder_test.cc +1 -1
  182. package/third_party/quiche/quiche/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc +1 -1
  183. package/third_party/quiche/quiche/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc +1 -1
  184. package/third_party/quiche/quiche/http2/decoder/payload_decoders/settings_payload_decoder_test.cc +1 -1
  185. package/third_party/quiche/quiche/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc +1 -1
  186. package/third_party/quiche/quiche/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc +1 -1
  187. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_block_decoder_test.cc +2 -2
  188. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_decoder_state_test.cc +8 -8
  189. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc +4 -3
  190. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_decoder_tables_test.cc +17 -17
  191. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_decoder_test.cc +25 -25
  192. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_entry_decoder_test.cc +2 -2
  193. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_entry_type_decoder_test.cc +7 -6
  194. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_string_decoder_test.cc +6 -6
  195. package/third_party/quiche/quiche/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc +1 -1
  196. package/third_party/quiche/quiche/http2/hpack/huffman/hpack_huffman_decoder_test.cc +2 -2
  197. package/third_party/quiche/quiche/http2/hpack/huffman/hpack_huffman_encoder_test.cc +1 -1
  198. package/third_party/quiche/quiche/http2/hpack/huffman/hpack_huffman_transcoder_test.cc +5 -5
  199. package/third_party/quiche/quiche/http2/hpack/varint/hpack_varint_decoder_test.cc +4 -4
  200. package/third_party/quiche/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc +1 -1
  201. package/third_party/quiche/quiche/http2/http2_constants_test.cc +1 -1
  202. package/third_party/quiche/quiche/http2/http2_structures_test.cc +23 -22
  203. package/third_party/quiche/quiche/http2/test_tools/frame_decoder_state_test_util.cc +1 -1
  204. package/third_party/quiche/quiche/http2/test_tools/frame_decoder_state_test_util.h +1 -1
  205. package/third_party/quiche/quiche/http2/test_tools/frame_parts.cc +38 -38
  206. package/third_party/quiche/quiche/http2/test_tools/hpack_block_collector.cc +15 -15
  207. package/third_party/quiche/quiche/http2/test_tools/hpack_entry_collector.cc +24 -22
  208. package/third_party/quiche/quiche/http2/test_tools/hpack_string_collector.cc +5 -5
  209. package/third_party/quiche/quiche/http2/test_tools/http2_frame_builder_test.cc +70 -89
  210. package/third_party/quiche/quiche/http2/test_tools/payload_decoder_base_test_util.cc +1 -1
  211. package/third_party/quiche/quiche/http2/test_tools/payload_decoder_base_test_util.h +29 -26
  212. package/third_party/quiche/quiche/http2/test_tools/{random_decoder_test.cc → random_decoder_test_base.cc} +13 -10
  213. package/third_party/quiche/quiche/http2/test_tools/{random_decoder_test.h → random_decoder_test_base.h} +15 -17
  214. package/third_party/quiche/quiche/http2/test_tools/{random_decoder_test_test.cc → random_decoder_test_base_test.cc} +1 -1
  215. package/third_party/quiche/quiche/http2/test_tools/verify_macros.h +32 -0
  216. package/third_party/quiche/quiche/quic/core/congestion_control/bbr2_sender.cc +2 -1
  217. package/third_party/quiche/quiche/quic/core/congestion_control/bbr2_simulator_test.cc +3 -2
  218. package/third_party/quiche/quiche/quic/core/congestion_control/bbr_sender_test.cc +3 -2
  219. package/third_party/quiche/quiche/quic/core/congestion_control/rtt_stats.cc +3 -2
  220. package/third_party/quiche/quiche/quic/core/congestion_control/rtt_stats.h +2 -1
  221. package/third_party/quiche/quiche/quic/core/congestion_control/rtt_stats_test.cc +2 -13
  222. package/third_party/quiche/quiche/quic/core/crypto/certificate_view.cc +15 -0
  223. package/third_party/quiche/quiche/quic/core/crypto/certificate_view.h +7 -0
  224. package/third_party/quiche/quiche/quic/core/crypto/certificate_view_test.cc +16 -0
  225. package/third_party/quiche/quiche/quic/core/crypto/crypto_protocol.h +1 -0
  226. package/third_party/quiche/quiche/quic/core/crypto/proof_source.h +2 -2
  227. package/third_party/quiche/quiche/quic/core/crypto/proof_source_x509.cc +3 -5
  228. package/third_party/quiche/quiche/quic/core/crypto/proof_source_x509.h +1 -2
  229. package/third_party/quiche/quiche/quic/core/crypto/quic_crypto_server_config.cc +1 -1
  230. package/third_party/quiche/quiche/quic/core/crypto/quic_crypto_server_config.h +3 -3
  231. package/third_party/quiche/quiche/quic/core/frames/quic_blocked_frame.cc +2 -8
  232. package/third_party/quiche/quiche/quic/core/frames/quic_blocked_frame.h +0 -1
  233. package/third_party/quiche/quiche/quic/core/frames/quic_crypto_frame.h +2 -0
  234. package/third_party/quiche/quiche/quic/core/frames/quic_frames_test.cc +2 -1
  235. package/third_party/quiche/quiche/quic/core/http/capsule.cc +2 -22
  236. package/third_party/quiche/quiche/quic/core/http/capsule.h +0 -2
  237. package/third_party/quiche/quiche/quic/core/http/capsule_test.cc +1 -2
  238. package/third_party/quiche/quiche/quic/core/http/end_to_end_test.cc +148 -57
  239. package/third_party/quiche/quiche/quic/core/http/http_constants.cc +1 -1
  240. package/third_party/quiche/quiche/quic/core/http/http_constants.h +2 -2
  241. package/third_party/quiche/quiche/quic/core/http/quic_header_list_test.cc +2 -2
  242. package/third_party/quiche/quiche/quic/core/http/quic_headers_stream_test.cc +18 -14
  243. package/third_party/quiche/quiche/quic/core/http/quic_send_control_stream.h +2 -1
  244. package/third_party/quiche/quiche/quic/core/http/quic_send_control_stream_test.cc +3 -7
  245. package/third_party/quiche/quiche/quic/core/http/quic_server_session_base.h +4 -0
  246. package/third_party/quiche/quiche/quic/core/http/quic_spdy_session.cc +47 -65
  247. package/third_party/quiche/quiche/quic/core/http/quic_spdy_session.h +5 -17
  248. package/third_party/quiche/quiche/quic/core/http/quic_spdy_session_test.cc +63 -54
  249. package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream.cc +34 -91
  250. package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream.h +1 -9
  251. package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream_test.cc +27 -134
  252. package/third_party/quiche/quiche/quic/core/http/spdy_utils.cc +0 -41
  253. package/third_party/quiche/quiche/quic/core/http/spdy_utils.h +0 -9
  254. package/third_party/quiche/quiche/quic/core/http/spdy_utils_test.cc +0 -32
  255. package/third_party/quiche/quiche/quic/core/http/web_transport_http3.cc +0 -1
  256. package/third_party/quiche/quiche/quic/core/packet_number_indexed_queue_test.cc +2 -2
  257. package/third_party/quiche/quiche/quic/core/qpack/qpack_header_table.cc +2 -1
  258. package/third_party/quiche/quiche/quic/core/qpack/qpack_send_stream.h +2 -1
  259. package/third_party/quiche/quiche/quic/core/quic_arena_scoped_ptr_test.cc +2 -2
  260. package/third_party/quiche/quiche/quic/core/quic_connection.cc +68 -46
  261. package/third_party/quiche/quiche/quic/core/quic_connection.h +7 -6
  262. package/third_party/quiche/quiche/quic/core/quic_connection_context_test.cc +2 -2
  263. package/third_party/quiche/quiche/quic/core/quic_connection_id_manager_test.cc +2 -2
  264. package/third_party/quiche/quiche/quic/core/quic_connection_id_test.cc +2 -2
  265. package/third_party/quiche/quiche/quic/core/quic_connection_test.cc +45 -132
  266. package/third_party/quiche/quiche/quic/core/quic_constants.h +0 -7
  267. package/third_party/quiche/quiche/quic/core/quic_control_frame_manager.cc +11 -3
  268. package/third_party/quiche/quiche/quic/core/quic_control_frame_manager.h +1 -1
  269. package/third_party/quiche/quiche/quic/core/quic_control_frame_manager_test.cc +2 -2
  270. package/third_party/quiche/quiche/quic/core/quic_crypto_client_handshaker.cc +13 -1
  271. package/third_party/quiche/quiche/quic/core/quic_crypto_client_handshaker.h +3 -0
  272. package/third_party/quiche/quiche/quic/core/quic_crypto_client_handshaker_test.cc +2 -2
  273. package/third_party/quiche/quiche/quic/core/quic_crypto_client_stream.cc +6 -0
  274. package/third_party/quiche/quiche/quic/core/quic_crypto_client_stream.h +8 -0
  275. package/third_party/quiche/quiche/quic/core/quic_crypto_server_stream.cc +26 -13
  276. package/third_party/quiche/quiche/quic/core/quic_crypto_server_stream.h +5 -2
  277. package/third_party/quiche/quiche/quic/core/quic_crypto_stream.cc +55 -47
  278. package/third_party/quiche/quiche/quic/core/quic_crypto_stream.h +15 -10
  279. package/third_party/quiche/quiche/quic/core/quic_crypto_stream_test.cc +34 -5
  280. package/third_party/quiche/quiche/quic/core/quic_dispatcher.cc +20 -11
  281. package/third_party/quiche/quiche/quic/core/quic_dispatcher_test.cc +37 -13
  282. package/third_party/quiche/quiche/quic/core/quic_flags_list.h +6 -10
  283. package/third_party/quiche/quiche/quic/core/quic_flow_controller.cc +3 -3
  284. package/third_party/quiche/quiche/quic/core/quic_flow_controller.h +2 -2
  285. package/third_party/quiche/quiche/quic/core/quic_flow_controller_test.cc +15 -10
  286. package/third_party/quiche/quiche/quic/core/quic_framer.cc +1 -1
  287. package/third_party/quiche/quiche/quic/core/quic_one_block_arena.h +3 -2
  288. package/third_party/quiche/quiche/quic/core/quic_one_block_arena_test.cc +2 -2
  289. package/third_party/quiche/quiche/quic/core/quic_packet_creator.cc +3 -11
  290. package/third_party/quiche/quiche/quic/core/quic_packet_creator.h +0 -8
  291. package/third_party/quiche/quiche/quic/core/quic_ping_manager.cc +14 -14
  292. package/third_party/quiche/quiche/quic/core/quic_ping_manager_test.cc +48 -0
  293. package/third_party/quiche/quiche/quic/core/quic_received_packet_manager.cc +3 -18
  294. package/third_party/quiche/quiche/quic/core/quic_received_packet_manager_test.cc +4 -14
  295. package/third_party/quiche/quiche/quic/core/quic_server_id_test.cc +2 -2
  296. package/third_party/quiche/quiche/quic/core/quic_session.cc +4 -4
  297. package/third_party/quiche/quiche/quic/core/quic_session.h +1 -1
  298. package/third_party/quiche/quiche/quic/core/quic_session_test.cc +21 -1
  299. package/third_party/quiche/quiche/quic/core/quic_stream.cc +4 -7
  300. package/third_party/quiche/quiche/quic/core/quic_stream_test.cc +2 -4
  301. package/third_party/quiche/quiche/quic/core/quic_trace_visitor_test.cc +2 -2
  302. package/third_party/quiche/quiche/quic/core/quic_types.h +3 -8
  303. package/third_party/quiche/quiche/quic/core/quic_udp_socket_posix.cc +5 -4
  304. package/third_party/quiche/quiche/quic/core/quic_unacked_packet_map_test.cc +1 -1
  305. package/third_party/quiche/quiche/quic/core/quic_utils.cc +1 -1
  306. package/third_party/quiche/quiche/quic/core/quic_utils.h +2 -2
  307. package/third_party/quiche/quiche/quic/core/quic_versions_test.cc +0 -1
  308. package/third_party/quiche/quiche/quic/core/tls_client_handshaker.cc +13 -0
  309. package/third_party/quiche/quiche/quic/core/tls_client_handshaker.h +2 -0
  310. package/third_party/quiche/quiche/quic/core/tls_server_handshaker.cc +17 -3
  311. package/third_party/quiche/quiche/quic/core/tls_server_handshaker.h +3 -1
  312. package/third_party/quiche/quiche/quic/core/uber_received_packet_manager_test.cc +18 -10
  313. package/third_party/quiche/quiche/quic/masque/masque_client_bin.cc +6 -4
  314. package/third_party/quiche/quiche/quic/masque/masque_client_session.cc +23 -7
  315. package/third_party/quiche/quiche/quic/masque/masque_client_session.h +1 -1
  316. package/third_party/quiche/quiche/quic/masque/masque_server_backend.cc +13 -0
  317. package/third_party/quiche/quiche/quic/masque/masque_server_backend.h +2 -0
  318. package/third_party/quiche/quiche/quic/masque/masque_server_bin.cc +5 -4
  319. package/third_party/quiche/quiche/quic/masque/masque_server_session.cc +30 -40
  320. package/third_party/quiche/quiche/quic/masque/masque_server_session.h +1 -1
  321. package/third_party/quiche/quiche/quic/platform/api/quic_export.h +4 -4
  322. package/third_party/quiche/quiche/quic/platform/api/quic_flags.h +0 -1
  323. package/third_party/quiche/quiche/quic/platform/api/quic_logging.h +0 -6
  324. package/third_party/quiche/quiche/quic/platform/api/quic_test.h +6 -5
  325. package/third_party/quiche/quiche/quic/qbone/bonnet/icmp_reachable_test.cc +2 -2
  326. package/third_party/quiche/quiche/quic/qbone/bonnet/mock_qbone_tunnel.h +2 -0
  327. package/third_party/quiche/quiche/quic/qbone/bonnet/qbone_tunnel_interface.h +2 -0
  328. package/third_party/quiche/quiche/quic/qbone/bonnet/tun_device_controller_test.cc +2 -2
  329. package/third_party/quiche/quiche/quic/qbone/bonnet/tun_device_packet_exchanger_test.cc +2 -2
  330. package/third_party/quiche/quiche/quic/qbone/bonnet/tun_device_test.cc +2 -2
  331. package/third_party/quiche/quiche/quic/qbone/platform/netlink_test.cc +2 -2
  332. package/third_party/quiche/quiche/quic/qbone/platform/tcp_packet.cc +5 -4
  333. package/third_party/quiche/quiche/quic/qbone/qbone_client_session.cc +4 -2
  334. package/third_party/quiche/quiche/quic/qbone/qbone_packet_processor.cc +2 -1
  335. package/third_party/quiche/quiche/quic/qbone/qbone_packet_processor_test.cc +2 -2
  336. package/third_party/quiche/quiche/quic/qbone/qbone_server_session.cc +4 -2
  337. package/third_party/quiche/quiche/quic/qbone/qbone_session_base.cc +3 -2
  338. package/third_party/quiche/quiche/quic/qbone/qbone_stream.cc +4 -4
  339. package/third_party/quiche/quiche/quic/test_tools/quic_connection_peer.cc +1 -1
  340. package/third_party/quiche/quiche/quic/test_tools/quic_http_response_cache_data/test.example.com/index.html +63 -0
  341. package/third_party/quiche/quiche/quic/test_tools/quic_http_response_cache_data/test.example.com/map.html +65 -0
  342. package/third_party/quiche/quiche/quic/test_tools/quic_test_utils.cc +4 -3
  343. package/third_party/quiche/quiche/quic/test_tools/quic_test_utils.h +18 -1
  344. package/third_party/quiche/quiche/quic/test_tools/simulator/quic_endpoint_test.cc +1 -1
  345. package/third_party/quiche/quiche/quic/test_tools/simulator/simulator_test.cc +1 -1
  346. package/third_party/quiche/quiche/quic/test_tools/test_ticket_crypter.cc +1 -1
  347. package/third_party/quiche/quiche/quic/test_tools/test_ticket_crypter.h +2 -2
  348. package/third_party/quiche/quiche/quic/{core/crypto → tools}/crypto_message_printer_bin.cc +0 -0
  349. package/third_party/quiche/quiche/quic/{core/qpack → tools}/qpack_offline_decoder_bin.cc +0 -0
  350. package/third_party/quiche/quiche/quic/tools/quic_client_interop_test_bin.cc +4 -3
  351. package/third_party/quiche/quiche/quic/tools/quic_memory_cache_backend_test.cc +3 -31
  352. package/third_party/quiche/quiche/quic/tools/quic_packet_printer_bin.cc +2 -2
  353. package/third_party/quiche/quiche/quic/tools/quic_simple_server_session.h +1 -1
  354. package/third_party/quiche/quiche/quic/tools/quic_simple_server_session_test.cc +1 -1
  355. package/third_party/quiche/quiche/quic/tools/quic_toy_client.cc +52 -38
  356. package/third_party/quiche/quiche/quic/tools/quic_toy_server.cc +10 -7
  357. package/third_party/quiche/quiche/quic/tools/simple_ticket_crypter.cc +1 -1
  358. package/third_party/quiche/quiche/quic/tools/simple_ticket_crypter.h +1 -1
  359. package/third_party/quiche/quiche/quic/tools/web_transport_test_visitors.h +3 -2
  360. package/third_party/quiche/quiche/spdy/core/array_output_buffer.h +1 -1
  361. package/third_party/quiche/quiche/spdy/core/hpack/hpack_decoder_adapter_test.cc +1 -1
  362. package/third_party/quiche/quiche/spdy/core/hpack/hpack_encoder_test.cc +2 -1
  363. package/third_party/quiche/quiche/spdy/core/hpack/hpack_header_table_test.cc +1 -1
  364. package/third_party/quiche/quiche/spdy/core/hpack/hpack_round_trip_test.cc +2 -1
  365. package/third_party/quiche/quiche/spdy/core/hpack/hpack_static_table_test.cc +1 -1
  366. package/third_party/quiche/quiche/spdy/core/http2_frame_decoder_adapter.cc +8 -6
  367. package/third_party/quiche/quiche/spdy/core/http2_frame_decoder_adapter.h +17 -6
  368. package/third_party/quiche/quiche/spdy/core/metadata_extension.cc +1 -1
  369. package/third_party/quiche/quiche/spdy/core/metadata_extension_test.cc +1 -1
  370. package/third_party/quiche/quiche/spdy/core/spdy_framer_test.cc +21 -17
  371. package/third_party/quiche/quiche/spdy/core/spdy_intrusive_list_test.cc +3 -3
  372. package/third_party/quiche/quiche/spdy/core/spdy_no_op_visitor.h +6 -4
  373. package/third_party/quiche/quiche/spdy/core/spdy_pinnable_buffer_piece_test.cc +1 -1
  374. package/third_party/quiche/quiche/spdy/core/spdy_prefixed_buffer_reader_test.cc +1 -1
  375. package/third_party/quiche/quiche/spdy/core/spdy_protocol_test.cc +1 -1
  376. package/third_party/quiche/quiche/spdy/test_tools/mock_spdy_framer_visitor.h +5 -4
  377. package/third_party/boringssl/src/util/bot/cmake-win32.zip.sha1 +0 -1
  378. package/third_party/quiche/quiche/common/platform/api/quiche_mock_log.h +0 -18
  379. package/third_party/quiche/quiche/common/platform/api/quiche_test_helpers.h +0 -8
  380. package/third_party/quiche/quiche/quic/platform/api/quic_mock_log.h +0 -19
  381. package/third_party/quiche/quiche/quic/tools/quic_transport_simple_server_dispatcher.cc +0 -51
  382. package/third_party/quiche/quiche/quic/tools/quic_transport_simple_server_dispatcher.h +0 -41
  383. package/third_party/quiche/quiche/quic/tools/quic_transport_simple_server_session.cc +0 -168
  384. package/third_party/quiche/quiche/quic/tools/quic_transport_simple_server_session.h +0 -78
@@ -9,8 +9,8 @@
9
9
  #include "quiche/http2/adapter/oghttp2_util.h"
10
10
  #include "quiche/http2/adapter/test_frame_sequence.h"
11
11
  #include "quiche/http2/adapter/test_utils.h"
12
+ #include "quiche/common/platform/api/quiche_expect_bug.h"
12
13
  #include "quiche/common/platform/api/quiche_test.h"
13
- #include "quiche/common/platform/api/quiche_test_helpers.h"
14
14
 
15
15
  namespace http2 {
16
16
  namespace adapter {
@@ -4531,6 +4531,63 @@ TEST(OgHttp2AdapterTest, IncompleteRequestWithServerResponseRstStreamEnabled) {
4531
4531
  EXPECT_FALSE(adapter->want_write());
4532
4532
  }
4533
4533
 
4534
+ TEST(OgHttp2AdapterTest, ServerHandlesMultipleContentLength) {
4535
+ DataSavingVisitor visitor;
4536
+ OgHttp2Adapter::Options options;
4537
+ options.perspective = Perspective::kServer;
4538
+ auto adapter = OgHttp2Adapter::Create(visitor, options);
4539
+ EXPECT_FALSE(adapter->want_write());
4540
+
4541
+ const std::string frames = TestFrameSequence()
4542
+ .ClientPreface()
4543
+ .Headers(1,
4544
+ {{":method", "POST"},
4545
+ {":scheme", "https"},
4546
+ {":authority", "example.com"},
4547
+ {":path", "/1"},
4548
+ {"content-length", "7"},
4549
+ {"content-length", "7"}},
4550
+ /*fin=*/false)
4551
+ .Headers(3,
4552
+ {{":method", "POST"},
4553
+ {":scheme", "https"},
4554
+ {":authority", "example.com"},
4555
+ {":path", "/3"},
4556
+ {"content-length", "11"},
4557
+ {"content-length", "13"}},
4558
+ /*fin=*/false)
4559
+ .Serialize();
4560
+ testing::InSequence s;
4561
+
4562
+ // Client preface (empty SETTINGS)
4563
+ EXPECT_CALL(visitor, OnFrameHeader(0, 0, SETTINGS, 0));
4564
+ EXPECT_CALL(visitor, OnSettingsStart());
4565
+ EXPECT_CALL(visitor, OnSettingsEnd());
4566
+ // Stream 1
4567
+ EXPECT_CALL(visitor, OnFrameHeader(1, _, HEADERS, 4));
4568
+ EXPECT_CALL(visitor, OnBeginHeadersForStream(1));
4569
+ EXPECT_CALL(visitor, OnHeaderForStream(1, ":method", "POST"));
4570
+ EXPECT_CALL(visitor, OnHeaderForStream(1, ":scheme", "https"));
4571
+ EXPECT_CALL(visitor, OnHeaderForStream(1, ":authority", "example.com"));
4572
+ EXPECT_CALL(visitor, OnHeaderForStream(1, ":path", "/1"));
4573
+ EXPECT_CALL(visitor, OnHeaderForStream(1, "content-length", "7"));
4574
+ EXPECT_CALL(visitor, OnEndHeadersForStream(1));
4575
+ // Stream 3
4576
+ EXPECT_CALL(visitor, OnFrameHeader(3, _, HEADERS, 4));
4577
+ EXPECT_CALL(visitor, OnBeginHeadersForStream(3));
4578
+ EXPECT_CALL(visitor, OnHeaderForStream(3, ":method", "POST"));
4579
+ EXPECT_CALL(visitor, OnHeaderForStream(3, ":scheme", "https"));
4580
+ EXPECT_CALL(visitor, OnHeaderForStream(3, ":authority", "example.com"));
4581
+ EXPECT_CALL(visitor, OnHeaderForStream(3, ":path", "/3"));
4582
+ EXPECT_CALL(visitor, OnHeaderForStream(3, "content-length", "11"));
4583
+ EXPECT_CALL(
4584
+ visitor,
4585
+ OnInvalidFrame(3, Http2VisitorInterface::InvalidFrameError::kHttpHeader));
4586
+
4587
+ const int64_t result = adapter->ProcessBytes(frames);
4588
+ EXPECT_EQ(frames.size(), static_cast<size_t>(result));
4589
+ }
4590
+
4534
4591
  TEST(OgHttp2AdapterTest, ServerSendsInvalidTrailers) {
4535
4592
  DataSavingVisitor visitor;
4536
4593
  OgHttp2Adapter::Options options;
@@ -4683,9 +4740,8 @@ TEST(OgHttp2AdapterTest, ServerQueuesMetadataThenTrailers) {
4683
4740
  ASSERT_EQ(trailer_result, 0);
4684
4741
  EXPECT_TRUE(adapter->want_write());
4685
4742
 
4686
- // BUG! The library forgets to serialize and send the metadata.
4687
- // EXPECT_CALL(visitor, OnBeforeFrameSent(kMetadataFrameType, 1, _, 0x4));
4688
- // EXPECT_CALL(visitor, OnFrameSent(kMetadataFrameType, 1, _, 0x4, 0));
4743
+ EXPECT_CALL(visitor, OnBeforeFrameSent(kMetadataFrameType, 1, _, 0x4));
4744
+ EXPECT_CALL(visitor, OnFrameSent(kMetadataFrameType, 1, _, 0x4, 0));
4689
4745
 
4690
4746
  EXPECT_CALL(visitor, OnBeforeFrameSent(HEADERS, 1, _, 0x5));
4691
4747
  EXPECT_CALL(visitor, OnFrameSent(HEADERS, 1, _, 0x5, 0));
@@ -4694,7 +4750,9 @@ TEST(OgHttp2AdapterTest, ServerQueuesMetadataThenTrailers) {
4694
4750
 
4695
4751
  send_result = adapter->Send();
4696
4752
  EXPECT_EQ(0, send_result);
4697
- EXPECT_THAT(visitor.data(), EqualsFrames({SpdyFrameType::HEADERS}));
4753
+ EXPECT_THAT(visitor.data(),
4754
+ EqualsFrames({static_cast<SpdyFrameType>(kMetadataFrameType),
4755
+ SpdyFrameType::HEADERS}));
4698
4756
  }
4699
4757
 
4700
4758
  TEST(OgHttp2AdapterTest, ServerHandlesDataWithPadding) {
@@ -7375,6 +7433,129 @@ TEST(OgHttp2AdapterTest, ServerUsesCustomWindowUpdateStrategy) {
7375
7433
  SpdyFrameType::WINDOW_UPDATE}));
7376
7434
  }
7377
7435
 
7436
+ // Verifies that NoopHeaderValidator allows several header combinations that
7437
+ // would otherwise be invalid.
7438
+ TEST(OgHttp2AdapterTest, NoopHeaderValidatorTest) {
7439
+ DataSavingVisitor visitor;
7440
+ OgHttp2Adapter::Options options;
7441
+ options.perspective = Perspective::kServer;
7442
+ options.validate_http_headers = false;
7443
+ auto adapter = OgHttp2Adapter::Create(visitor, options);
7444
+
7445
+ const std::string frames = TestFrameSequence()
7446
+ .ClientPreface()
7447
+ .Headers(1,
7448
+ {{":method", "POST"},
7449
+ {":scheme", "https"},
7450
+ {":authority", "example.com"},
7451
+ {":path", "/1"},
7452
+ {"content-length", "7"},
7453
+ {"content-length", "7"}},
7454
+ /*fin=*/false)
7455
+ .Headers(3,
7456
+ {{":method", "POST"},
7457
+ {":scheme", "https"},
7458
+ {":authority", "example.com"},
7459
+ {":path", "/3"},
7460
+ {"content-length", "11"},
7461
+ {"content-length", "13"}},
7462
+ /*fin=*/false)
7463
+ .Headers(5,
7464
+ {{":method", "POST"},
7465
+ {":scheme", "https"},
7466
+ {":authority", "foo.com"},
7467
+ {":path", "/"},
7468
+ {"host", "bar.com"}},
7469
+ /*fin=*/true)
7470
+ .Headers(7,
7471
+ {{":method", "POST"},
7472
+ {":scheme", "https"},
7473
+ {":authority", "example.com"},
7474
+ {":path", "/"},
7475
+ {"Accept", "uppercase, oh boy!"}},
7476
+ /*fin=*/false)
7477
+ .Headers(9,
7478
+ {{":method", "POST"},
7479
+ {":scheme", "https"},
7480
+ {":authority", "ex|ample.com"},
7481
+ {":path", "/"}},
7482
+ /*fin=*/false)
7483
+ .Headers(11,
7484
+ {{":method", "GET"},
7485
+ {":scheme", "https"},
7486
+ {":authority", "example.com"},
7487
+ {":path", "/"},
7488
+ {"content-length", "nan"}},
7489
+ /*fin=*/true)
7490
+ .Serialize();
7491
+ testing::InSequence s;
7492
+
7493
+ // Client preface (empty SETTINGS)
7494
+ EXPECT_CALL(visitor, OnFrameHeader(0, 0, SETTINGS, 0));
7495
+ EXPECT_CALL(visitor, OnSettingsStart());
7496
+ EXPECT_CALL(visitor, OnSettingsEnd());
7497
+ // Stream 1
7498
+ EXPECT_CALL(visitor, OnFrameHeader(1, _, HEADERS, 4));
7499
+ EXPECT_CALL(visitor, OnBeginHeadersForStream(1));
7500
+ EXPECT_CALL(visitor, OnHeaderForStream(1, ":method", "POST"));
7501
+ EXPECT_CALL(visitor, OnHeaderForStream(1, ":scheme", "https"));
7502
+ EXPECT_CALL(visitor, OnHeaderForStream(1, ":authority", "example.com"));
7503
+ EXPECT_CALL(visitor, OnHeaderForStream(1, ":path", "/1"));
7504
+ EXPECT_CALL(visitor, OnHeaderForStream(1, "content-length", "7"));
7505
+ EXPECT_CALL(visitor, OnHeaderForStream(1, "content-length", "7"));
7506
+ EXPECT_CALL(visitor, OnEndHeadersForStream(1));
7507
+ // Stream 3
7508
+ EXPECT_CALL(visitor, OnFrameHeader(3, _, HEADERS, 4));
7509
+ EXPECT_CALL(visitor, OnBeginHeadersForStream(3));
7510
+ EXPECT_CALL(visitor, OnHeaderForStream(3, ":method", "POST"));
7511
+ EXPECT_CALL(visitor, OnHeaderForStream(3, ":scheme", "https"));
7512
+ EXPECT_CALL(visitor, OnHeaderForStream(3, ":authority", "example.com"));
7513
+ EXPECT_CALL(visitor, OnHeaderForStream(3, ":path", "/3"));
7514
+ EXPECT_CALL(visitor, OnHeaderForStream(3, "content-length", "11"));
7515
+ EXPECT_CALL(visitor, OnHeaderForStream(3, "content-length", "13"));
7516
+ EXPECT_CALL(visitor, OnEndHeadersForStream(3));
7517
+ // Stream 5
7518
+ EXPECT_CALL(visitor, OnFrameHeader(5, _, HEADERS, 5));
7519
+ EXPECT_CALL(visitor, OnBeginHeadersForStream(5));
7520
+ EXPECT_CALL(visitor, OnHeaderForStream(5, ":method", "POST"));
7521
+ EXPECT_CALL(visitor, OnHeaderForStream(5, ":scheme", "https"));
7522
+ EXPECT_CALL(visitor, OnHeaderForStream(5, ":authority", "foo.com"));
7523
+ EXPECT_CALL(visitor, OnHeaderForStream(5, ":path", "/"));
7524
+ EXPECT_CALL(visitor, OnHeaderForStream(5, "host", "bar.com"));
7525
+ EXPECT_CALL(visitor, OnEndHeadersForStream(5));
7526
+ EXPECT_CALL(visitor, OnEndStream(5));
7527
+ // Stream 7
7528
+ EXPECT_CALL(visitor, OnFrameHeader(7, _, HEADERS, 4));
7529
+ EXPECT_CALL(visitor, OnBeginHeadersForStream(7));
7530
+ EXPECT_CALL(visitor, OnHeaderForStream(7, ":method", "POST"));
7531
+ EXPECT_CALL(visitor, OnHeaderForStream(7, ":scheme", "https"));
7532
+ EXPECT_CALL(visitor, OnHeaderForStream(7, ":authority", "example.com"));
7533
+ EXPECT_CALL(visitor, OnHeaderForStream(7, ":path", "/"));
7534
+ EXPECT_CALL(visitor, OnHeaderForStream(7, "Accept", "uppercase, oh boy!"));
7535
+ EXPECT_CALL(visitor, OnEndHeadersForStream(7));
7536
+ // Stream 9
7537
+ EXPECT_CALL(visitor, OnFrameHeader(9, _, HEADERS, 4));
7538
+ EXPECT_CALL(visitor, OnBeginHeadersForStream(9));
7539
+ EXPECT_CALL(visitor, OnHeaderForStream(9, ":method", "POST"));
7540
+ EXPECT_CALL(visitor, OnHeaderForStream(9, ":scheme", "https"));
7541
+ EXPECT_CALL(visitor, OnHeaderForStream(9, ":authority", "ex|ample.com"));
7542
+ EXPECT_CALL(visitor, OnHeaderForStream(9, ":path", "/"));
7543
+ EXPECT_CALL(visitor, OnEndHeadersForStream(9));
7544
+ // Stream 11
7545
+ EXPECT_CALL(visitor, OnFrameHeader(11, _, HEADERS, 5));
7546
+ EXPECT_CALL(visitor, OnBeginHeadersForStream(11));
7547
+ EXPECT_CALL(visitor, OnHeaderForStream(11, ":method", "GET"));
7548
+ EXPECT_CALL(visitor, OnHeaderForStream(11, ":scheme", "https"));
7549
+ EXPECT_CALL(visitor, OnHeaderForStream(11, ":authority", "example.com"));
7550
+ EXPECT_CALL(visitor, OnHeaderForStream(11, ":path", "/"));
7551
+ EXPECT_CALL(visitor, OnHeaderForStream(11, "content-length", "nan"));
7552
+ EXPECT_CALL(visitor, OnEndHeadersForStream(11));
7553
+ EXPECT_CALL(visitor, OnEndStream(11));
7554
+
7555
+ const int64_t result = adapter->ProcessBytes(frames);
7556
+ EXPECT_EQ(frames.size(), static_cast<size_t>(result));
7557
+ }
7558
+
7378
7559
  } // namespace
7379
7560
  } // namespace test
7380
7561
  } // namespace adapter
@@ -10,6 +10,7 @@
10
10
  #include "quiche/http2/adapter/http2_protocol.h"
11
11
  #include "quiche/http2/adapter/http2_util.h"
12
12
  #include "quiche/http2/adapter/http2_visitor_interface.h"
13
+ #include "quiche/http2/adapter/noop_header_validator.h"
13
14
  #include "quiche/http2/adapter/oghttp2_util.h"
14
15
  #include "quiche/spdy/core/spdy_protocol.h"
15
16
 
@@ -216,6 +217,18 @@ bool IsNonAckSettings(const spdy::SpdyFrameIR& frame) {
216
217
 
217
218
  } // namespace
218
219
 
220
+ OgHttp2Session::PassthroughHeadersHandler::PassthroughHeadersHandler(
221
+ OgHttp2Session& session, Http2VisitorInterface& visitor)
222
+ : session_(session), visitor_(visitor) {
223
+ if (session_.options_.validate_http_headers) {
224
+ QUICHE_VLOG(2) << "instantiating regular header validator";
225
+ validator_ = absl::make_unique<HeaderValidator>();
226
+ } else {
227
+ QUICHE_VLOG(2) << "instantiating noop header validator";
228
+ validator_ = absl::make_unique<NoopHeaderValidator>();
229
+ }
230
+ }
231
+
219
232
  void OgHttp2Session::PassthroughHeadersHandler::OnHeaderBlockStart() {
220
233
  result_ = Http2VisitorInterface::HEADER_OK;
221
234
  const bool status = visitor_.OnBeginHeadersForStream(stream_id_);
@@ -224,13 +237,14 @@ void OgHttp2Session::PassthroughHeadersHandler::OnHeaderBlockStart() {
224
237
  << "Visitor rejected header block, returning HEADER_CONNECTION_ERROR";
225
238
  result_ = Http2VisitorInterface::HEADER_CONNECTION_ERROR;
226
239
  }
227
- validator_.StartHeaderBlock();
240
+ validator_->StartHeaderBlock();
228
241
  }
229
242
 
230
243
  Http2VisitorInterface::OnHeaderResult InterpretHeaderStatus(
231
244
  HeaderValidator::HeaderStatus status) {
232
245
  switch (status) {
233
246
  case HeaderValidator::HEADER_OK:
247
+ case HeaderValidator::HEADER_SKIP:
234
248
  return Http2VisitorInterface::HEADER_OK;
235
249
  case HeaderValidator::HEADER_FIELD_INVALID:
236
250
  return Http2VisitorInterface::HEADER_FIELD_INVALID;
@@ -247,7 +261,10 @@ void OgHttp2Session::PassthroughHeadersHandler::OnHeader(
247
261
  return;
248
262
  }
249
263
  const HeaderValidator::HeaderStatus validation_result =
250
- validator_.ValidateSingleHeader(key, value);
264
+ validator_->ValidateSingleHeader(key, value);
265
+ if (validation_result == HeaderValidator::HEADER_SKIP) {
266
+ return;
267
+ }
251
268
  if (validation_result != HeaderValidator::HEADER_OK) {
252
269
  QUICHE_VLOG(2) << "Header validation failed with result "
253
270
  << static_cast<int>(validation_result);
@@ -261,7 +278,7 @@ void OgHttp2Session::PassthroughHeadersHandler::OnHeaderBlockEnd(
261
278
  size_t /* uncompressed_header_bytes */,
262
279
  size_t /* compressed_header_bytes */) {
263
280
  if (result_ == Http2VisitorInterface::HEADER_OK) {
264
- if (!validator_.FinishHeaderBlock(type_)) {
281
+ if (!validator_->FinishHeaderBlock(type_)) {
265
282
  QUICHE_VLOG(1) << "FinishHeaderBlock returned false; returning "
266
283
  "HEADER_HTTP_MESSAGING";
267
284
  result_ = Http2VisitorInterface::HEADER_HTTP_MESSAGING;
@@ -322,6 +339,7 @@ struct OgHttp2Session::ProcessBytesResultVisitor {
322
339
 
323
340
  OgHttp2Session::OgHttp2Session(Http2VisitorInterface& visitor, Options options)
324
341
  : visitor_(visitor),
342
+ options_(options),
325
343
  event_forwarder_([this]() { return !latched_error_; }, *this),
326
344
  receive_logger_(
327
345
  &event_forwarder_, TracePerspectiveAsString(options.perspective),
@@ -337,8 +355,7 @@ OgHttp2Session::OgHttp2Session(Http2VisitorInterface& visitor, Options options)
337
355
  SendWindowUpdate(kConnectionStreamId, window_update_delta);
338
356
  },
339
357
  options.should_window_update_fn,
340
- /*update_window_on_notify=*/false),
341
- options_(options) {
358
+ /*update_window_on_notify=*/false) {
342
359
  decoder_.set_visitor(&receive_logger_);
343
360
  decoder_.set_extension_visitor(this);
344
361
  if (options_.max_header_list_bytes) {
@@ -588,10 +605,6 @@ int OgHttp2Session::Send() {
588
605
  // case, return early here to avoid sending other frames.
589
606
  return InterpretSendResult(continue_writing);
590
607
  }
591
- while (continue_writing == SendResult::SEND_OK &&
592
- !connection_metadata_.empty()) {
593
- continue_writing = SendMetadata(0, connection_metadata_);
594
- }
595
608
  // Notify on new/pending streams closed due to GOAWAY receipt.
596
609
  CloseGoAwayRejectedStreams();
597
610
  // Wake streams for writes.
@@ -618,18 +631,12 @@ int OgHttp2Session::InterpretSendResult(SendResult result) {
618
631
  }
619
632
 
620
633
  bool OgHttp2Session::HasReadyStream() const {
621
- return !metadata_ready_.empty() || !trailers_ready_.empty() ||
634
+ return !trailers_ready_.empty() ||
622
635
  (write_scheduler_.HasReadyStreams() && connection_send_window_ > 0);
623
636
  }
624
637
 
625
638
  Http2StreamId OgHttp2Session::GetNextReadyStream() {
626
639
  QUICHE_DCHECK(HasReadyStream());
627
- if (!metadata_ready_.empty()) {
628
- const Http2StreamId stream_id = *metadata_ready_.begin();
629
- // WriteForStream() will re-mark the stream as ready, if necessary.
630
- write_scheduler_.MarkStreamNotReady(stream_id);
631
- return stream_id;
632
- }
633
640
  if (!trailers_ready_.empty()) {
634
641
  const Http2StreamId stream_id = *trailers_ready_.begin();
635
642
  // WriteForStream() will re-mark the stream as ready, if necessary.
@@ -786,14 +793,10 @@ OgHttp2Session::SendResult OgHttp2Session::WriteForStream(
786
793
  // HEADERS.
787
794
  state.outbound_body = nullptr;
788
795
  state.trailers = nullptr;
789
- state.outbound_metadata.clear();
790
796
  return SendResult::SEND_OK;
791
797
  }
792
- SendResult connection_can_write = SendResult::SEND_OK;
793
- if (!state.outbound_metadata.empty()) {
794
- connection_can_write = SendMetadata(stream_id, state.outbound_metadata);
795
- }
796
798
 
799
+ SendResult connection_can_write = SendResult::SEND_OK;
797
800
  if (state.outbound_body == nullptr ||
798
801
  (!options_.trailers_require_end_data && state.data_deferred)) {
799
802
  // No data to send, but there might be trailers.
@@ -900,19 +903,18 @@ OgHttp2Session::SendResult OgHttp2Session::WriteForStream(
900
903
  : SendResult::SEND_OK;
901
904
  }
902
905
 
903
- OgHttp2Session::SendResult OgHttp2Session::SendMetadata(
904
- Http2StreamId stream_id, OgHttp2Session::MetadataSequence& sequence) {
906
+ void OgHttp2Session::SerializeMetadata(Http2StreamId stream_id,
907
+ std::unique_ptr<MetadataSource> source) {
905
908
  const uint32_t max_payload_size =
906
909
  std::min(kMaxAllowedMetadataFrameSize, max_frame_payload_);
907
910
  auto payload_buffer = absl::make_unique<uint8_t[]>(max_payload_size);
908
- while (!sequence.empty()) {
909
- MetadataSource& source = *sequence.front();
910
911
 
912
+ while (true) {
911
913
  auto [written, end_metadata] =
912
- source.Pack(payload_buffer.get(), max_payload_size);
914
+ source->Pack(payload_buffer.get(), max_payload_size);
913
915
  if (written < 0) {
914
- // Did not touch the connection, so perhaps writes are still possible.
915
- return SendResult::SEND_OK;
916
+ // Unable to pack any metadata.
917
+ return;
916
918
  }
917
919
  QUICHE_DCHECK_LE(static_cast<size_t>(written), max_payload_size);
918
920
  auto payload = absl::string_view(
@@ -921,11 +923,9 @@ OgHttp2Session::SendResult OgHttp2Session::SendMetadata(
921
923
  stream_id, kMetadataFrameType, end_metadata ? kMetadataEndFlag : 0u,
922
924
  std::string(payload)));
923
925
  if (end_metadata) {
924
- sequence.erase(sequence.begin());
925
- metadata_ready_.erase(stream_id);
926
+ return;
926
927
  }
927
928
  }
928
- return SendQueuedFrames();
929
929
  }
930
930
 
931
931
  int32_t OgHttp2Session::SubmitRequest(
@@ -1003,13 +1003,7 @@ int OgHttp2Session::SubmitTrailer(Http2StreamId stream_id,
1003
1003
 
1004
1004
  void OgHttp2Session::SubmitMetadata(Http2StreamId stream_id,
1005
1005
  std::unique_ptr<MetadataSource> source) {
1006
- if (stream_id == 0) {
1007
- connection_metadata_.push_back(std::move(source));
1008
- } else {
1009
- auto iter = CreateStream(stream_id);
1010
- iter->second.outbound_metadata.push_back(std::move(source));
1011
- metadata_ready_.insert(stream_id);
1012
- }
1006
+ SerializeMetadata(stream_id, std::move(source));
1013
1007
  }
1014
1008
 
1015
1009
  void OgHttp2Session::SubmitSettings(absl::Span<const Http2Setting> settings) {
@@ -1344,7 +1338,8 @@ bool OgHttp2Session::OnGoAwayFrameData(const char* /*goaway_data*/, size_t
1344
1338
  }
1345
1339
 
1346
1340
  void OgHttp2Session::OnHeaders(spdy::SpdyStreamId stream_id,
1347
- bool /*has_priority*/, int /*weight*/,
1341
+ size_t /*payload_length*/, bool /*has_priority*/,
1342
+ int /*weight*/,
1348
1343
  spdy::SpdyStreamId /*parent_stream_id*/,
1349
1344
  bool /*exclusive*/, bool fin, bool /*end*/) {
1350
1345
  if (stream_id % 2 == 0) {
@@ -1440,8 +1435,8 @@ void OgHttp2Session::OnPushPromise(spdy::SpdyStreamId /*stream_id*/,
1440
1435
  ConnectionError::kInvalidPushPromise);
1441
1436
  }
1442
1437
 
1443
- void OgHttp2Session::OnContinuation(spdy::SpdyStreamId /*stream_id*/, bool
1444
- /*end*/) {}
1438
+ void OgHttp2Session::OnContinuation(spdy::SpdyStreamId /*stream_id*/,
1439
+ size_t /*payload_length*/, bool /*end*/) {}
1445
1440
 
1446
1441
  void OgHttp2Session::OnAltSvc(spdy::SpdyStreamId /*stream_id*/,
1447
1442
  absl::string_view /*origin*/,
@@ -1604,7 +1599,7 @@ void OgHttp2Session::HandleOutboundSettings(
1604
1599
  if (value == 1u && IsServerSession()) {
1605
1600
  // Allow extended CONNECT semantics even before SETTINGS are acked, to
1606
1601
  // make things easier for clients.
1607
- headers_handler_.AllowConnect();
1602
+ headers_handler_.SetAllowExtendedConnect();
1608
1603
  }
1609
1604
  break;
1610
1605
  case HEADER_TABLE_SIZE:
@@ -1754,7 +1749,6 @@ void OgHttp2Session::CloseStream(Http2StreamId stream_id,
1754
1749
  }
1755
1750
  stream_map_.erase(stream_id);
1756
1751
  trailers_ready_.erase(stream_id);
1757
- metadata_ready_.erase(stream_id);
1758
1752
  streams_reset_.erase(stream_id);
1759
1753
  queued_frames_.erase(stream_id);
1760
1754
  if (write_scheduler_.StreamRegistered(stream_id)) {
@@ -13,6 +13,7 @@
13
13
  #include "quiche/http2/adapter/data_source.h"
14
14
  #include "quiche/http2/adapter/event_forwarder.h"
15
15
  #include "quiche/http2/adapter/header_validator.h"
16
+ #include "quiche/http2/adapter/header_validator_base.h"
16
17
  #include "quiche/http2/adapter/http2_protocol.h"
17
18
  #include "quiche/http2/adapter/http2_session.h"
18
19
  #include "quiche/http2/adapter/http2_util.h"
@@ -71,6 +72,9 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
71
72
  // Whether to allow `obs-text` (characters from hexadecimal 0x80 to 0xff) in
72
73
  // header field values.
73
74
  bool allow_obs_text = true;
75
+ // If true, validates header field names and values according to RFC 7230
76
+ // and RFC 7540.
77
+ bool validate_http_headers = true;
74
78
  };
75
79
 
76
80
  OgHttp2Session(Http2VisitorInterface& visitor, Options options);
@@ -145,8 +149,7 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
145
149
  }
146
150
  bool want_write() const override {
147
151
  return !fatal_send_error_ &&
148
- (!frames_.empty() || !buffered_data_.empty() ||
149
- !connection_metadata_.empty() || HasReadyStream() ||
152
+ (!frames_.empty() || !buffered_data_.empty() || HasReadyStream() ||
150
153
  !goaway_rejected_streams_.empty());
151
154
  }
152
155
  int GetRemoteWindowSize() const override { return connection_send_window_; }
@@ -177,14 +180,16 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
177
180
  void OnGoAway(spdy::SpdyStreamId last_accepted_stream_id,
178
181
  spdy::SpdyErrorCode error_code) override;
179
182
  bool OnGoAwayFrameData(const char* goaway_data, size_t len) override;
180
- void OnHeaders(spdy::SpdyStreamId stream_id, bool has_priority, int weight,
183
+ void OnHeaders(spdy::SpdyStreamId stream_id, size_t payload_length,
184
+ bool has_priority, int weight,
181
185
  spdy::SpdyStreamId parent_stream_id, bool exclusive, bool fin,
182
186
  bool end) override;
183
187
  void OnWindowUpdate(spdy::SpdyStreamId stream_id,
184
188
  int delta_window_size) override;
185
189
  void OnPushPromise(spdy::SpdyStreamId stream_id,
186
190
  spdy::SpdyStreamId promised_stream_id, bool end) override;
187
- void OnContinuation(spdy::SpdyStreamId stream_id, bool end) override;
191
+ void OnContinuation(spdy::SpdyStreamId stream_id, size_t payload_length,
192
+ bool end) override;
188
193
  void OnAltSvc(spdy::SpdyStreamId /*stream_id*/, absl::string_view /*origin*/,
189
194
  const spdy::SpdyAltSvcWireFormat::
190
195
  AlternativeServiceVector& /*altsvc_vector*/) override;
@@ -209,8 +214,6 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
209
214
  void OnFramePayload(const char* data, size_t len) override;
210
215
 
211
216
  private:
212
- using MetadataSequence = std::vector<std::unique_ptr<MetadataSource>>;
213
-
214
217
  struct QUICHE_EXPORT_PRIVATE StreamState {
215
218
  StreamState(int32_t stream_receive_window, int32_t stream_send_window,
216
219
  WindowManager::WindowUpdateListener listener,
@@ -222,7 +225,6 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
222
225
 
223
226
  WindowManager window_manager;
224
227
  std::unique_ptr<DataFrameSource> outbound_body;
225
- MetadataSequence outbound_metadata;
226
228
  std::unique_ptr<spdy::SpdyHeaderBlock> trailers;
227
229
  void* user_data = nullptr;
228
230
  int32_t send_window;
@@ -245,9 +247,8 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
245
247
  class QUICHE_EXPORT_PRIVATE PassthroughHeadersHandler
246
248
  : public spdy::SpdyHeadersHandlerInterface {
247
249
  public:
248
- explicit PassthroughHeadersHandler(OgHttp2Session& session,
249
- Http2VisitorInterface& visitor)
250
- : session_(session), visitor_(visitor) {}
250
+ PassthroughHeadersHandler(OgHttp2Session& session,
251
+ Http2VisitorInterface& visitor);
251
252
 
252
253
  void set_stream_id(Http2StreamId stream_id) {
253
254
  stream_id_ = stream_id;
@@ -265,18 +266,18 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
265
266
  absl::string_view status_header() const {
266
267
  QUICHE_DCHECK(type_ == HeaderType::RESPONSE ||
267
268
  type_ == HeaderType::RESPONSE_100);
268
- return validator_.status_header();
269
+ return validator_->status_header();
269
270
  }
270
271
  absl::optional<size_t> content_length() const {
271
- return validator_.content_length();
272
+ return validator_->content_length();
272
273
  }
273
- void AllowConnect() { validator_.AllowConnect(); }
274
+ void SetAllowExtendedConnect() { validator_->SetAllowExtendedConnect(); }
274
275
  void SetMaxFieldSize(uint32_t field_size) {
275
- validator_.SetMaxFieldSize(field_size);
276
+ validator_->SetMaxFieldSize(field_size);
276
277
  }
277
278
  void SetAllowObsText(bool allow) {
278
- validator_.SetObsTextOption(allow ? ObsTextOption::kAllow
279
- : ObsTextOption::kDisallow);
279
+ validator_->SetObsTextOption(allow ? ObsTextOption::kAllow
280
+ : ObsTextOption::kDisallow);
280
281
  }
281
282
  bool CanReceiveBody() const;
282
283
 
@@ -287,7 +288,7 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
287
288
  Http2VisitorInterface::OnHeaderResult result_ =
288
289
  Http2VisitorInterface::HEADER_OK;
289
290
  // Validates header blocks according to the HTTP/2 specification.
290
- HeaderValidator validator_;
291
+ std::unique_ptr<HeaderValidatorBase> validator_;
291
292
  HeaderType type_ = HeaderType::RESPONSE;
292
293
  bool frame_contains_fin_ = false;
293
294
  };
@@ -359,7 +360,8 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
359
360
  // Writes DATA frames for stream `stream_id`.
360
361
  SendResult WriteForStream(Http2StreamId stream_id);
361
362
 
362
- SendResult SendMetadata(Http2StreamId stream_id, MetadataSequence& sequence);
363
+ void SerializeMetadata(Http2StreamId stream_id,
364
+ std::unique_ptr<MetadataSource> source);
363
365
 
364
366
  void SendHeaders(Http2StreamId stream_id, spdy::SpdyHeaderBlock headers,
365
367
  bool end_stream);
@@ -429,6 +431,8 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
429
431
  // Receives events when inbound frames are parsed.
430
432
  Http2VisitorInterface& visitor_;
431
433
 
434
+ const Options options_;
435
+
432
436
  // Forwards received events to the session if it can accept them.
433
437
  EventForwarder event_forwarder_;
434
438
 
@@ -487,13 +491,9 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
487
491
  absl::flat_hash_map<Http2StreamId, int> queued_frames_;
488
492
  // Includes streams that are currently ready to write trailers.
489
493
  absl::flat_hash_set<Http2StreamId> trailers_ready_;
490
- // Includes streams that are currently ready to write metadata.
491
- absl::flat_hash_set<Http2StreamId> metadata_ready_;
492
494
  // Includes streams that will not be written due to receipt of GOAWAY.
493
495
  absl::flat_hash_set<Http2StreamId> goaway_rejected_streams_;
494
496
 
495
- MetadataSequence connection_metadata_;
496
-
497
497
  Http2StreamId next_stream_id_ = 1;
498
498
  // The highest received stream ID is the highest stream ID in any frame read
499
499
  // from the peer. The highest processed stream ID is the highest stream ID for
@@ -519,7 +519,6 @@ class QUICHE_EXPORT_PRIVATE OgHttp2Session
519
519
  std::numeric_limits<uint32_t>::max();
520
520
  uint32_t max_inbound_concurrent_streams_ =
521
521
  std::numeric_limits<uint32_t>::max();
522
- const Options options_;
523
522
 
524
523
  // The HPACK encoder header table capacity that will be applied when
525
524
  // acking SETTINGS from the peer. Only contains a value if the peer advertises
@@ -61,7 +61,7 @@ bool TestDataFrameSource::Send(absl::string_view frame_header,
61
61
  } else if (result == 0) {
62
62
  // Write blocked.
63
63
  return false;
64
- } else if (static_cast<const size_t>(result) < concatenated.size()) {
64
+ } else if (static_cast<size_t>(result) < concatenated.size()) {
65
65
  // Probably need to handle this better within this test class.
66
66
  QUICHE_LOG(DFATAL)
67
67
  << "DATA frame not fully flushed. Connection will be corrupt!";
@@ -4,8 +4,8 @@
4
4
 
5
5
  #include "absl/functional/bind_front.h"
6
6
  #include "quiche/http2/test_tools/http2_random.h"
7
+ #include "quiche/common/platform/api/quiche_expect_bug.h"
7
8
  #include "quiche/common/platform/api/quiche_test.h"
8
- #include "quiche/common/platform/api/quiche_test_helpers.h"
9
9
 
10
10
  namespace http2 {
11
11
  namespace adapter {
@@ -24,7 +24,7 @@ class WindowManagerPeer {
24
24
 
25
25
  namespace {
26
26
 
27
- class WindowManagerTest : public ::testing::Test {
27
+ class WindowManagerTest : public quiche::test::QuicheTest {
28
28
  protected:
29
29
  WindowManagerTest()
30
30
  : wm_(kDefaultLimit, absl::bind_front(&WindowManagerTest::OnCall, this)),
@@ -72,7 +72,9 @@ TEST_F(WindowManagerTest, DataBufferedAndFlushed) {
72
72
  wm_.MarkDataBuffered(buffered);
73
73
  total_buffered += buffered;
74
74
  EXPECT_TRUE(call_sequence_.empty());
75
- int64_t flushed = random_.Uniform(total_buffered - total_flushed);
75
+ int64_t flushed = (total_buffered - total_flushed) > 0
76
+ ? random_.Uniform(total_buffered - total_flushed)
77
+ : 0;
76
78
  wm_.MarkDataFlushed(flushed);
77
79
  total_flushed += flushed;
78
80
  }
@@ -99,8 +101,12 @@ TEST_F(WindowManagerTest, AvoidBufferedUnderflow) {
99
101
  wm_.MarkDataBuffered(42);
100
102
  EXPECT_EQ(peer_.buffered(), 42u);
101
103
  // Don't flush more than has been buffered!
102
- EXPECT_QUICHE_BUG(wm_.MarkDataFlushed(43), "buffered underflow");
103
- EXPECT_EQ(peer_.buffered(), 0u);
104
+ EXPECT_QUICHE_BUG(
105
+ {
106
+ wm_.MarkDataFlushed(43);
107
+ EXPECT_EQ(peer_.buffered(), 0u);
108
+ },
109
+ "buffered underflow");
104
110
  }
105
111
 
106
112
  // This test verifies that WindowManager notifies its listener when window is