Add `QuicheCodeCounter` to help size the impact of b/433557986
We are particularly interested in understanding the counts of the request parsing but we also add logging for response parsing to help us size their impact independently. If the count of `balsa_frame_framing_found_valid_term2_[request|response]` ends up being small enough, we can enforce RFC compliance unconditionally when reading the last chunk term.
Protected by refactor and incrementing of streamz.
PiperOrigin-RevId: 789347949
diff --git a/quiche/balsa/balsa_frame.cc b/quiche/balsa/balsa_frame.cc
index c9cfae2..7d63d51 100644
--- a/quiche/balsa/balsa_frame.cc
+++ b/quiche/balsa/balsa_frame.cc
@@ -20,6 +20,8 @@
#include "quiche/balsa/balsa_headers.h"
#include "quiche/balsa/balsa_visitor_interface.h"
#include "quiche/balsa/header_properties.h"
+#include "quiche/balsa/http_validation_policy.h"
+#include "quiche/common/platform/api/quiche_flag_utils.h"
#include "quiche/common/platform/api/quiche_logging.h"
// When comparing characters (other than == and !=), cast to unsigned char
@@ -1341,7 +1343,19 @@
}
const char c = *current;
- if (HeaderFramingFound(c) != 0) {
+ int32_t framing_found = HeaderFramingFound(c);
+ if (framing_found != 0) {
+ // TODO(b/433557986) remove these code counts
+ if (framing_found == kValidTerm1 && is_request_) {
+ QUICHE_CODE_COUNT(balsa_frame_framing_found_valid_term1_request);
+ } else if (framing_found == kValidTerm1 && !is_request_) {
+ QUICHE_CODE_COUNT(balsa_frame_framing_found_valid_term1_response);
+ } else if (framing_found == kValidTerm2 && is_request_) {
+ QUICHE_CODE_COUNT(balsa_frame_framing_found_valid_term2_request);
+ } else if (framing_found == kValidTerm2 && !is_request_) {
+ QUICHE_CODE_COUNT(balsa_frame_framing_found_valid_term2_response);
+ }
+
// If we've found a "\r\n\r\n", then the message
// is done.
++current;