Adds Http2VisitorInterface::OnInvalidFrame() and associate plumbing. This method notifies the visitor that the library has processed a frame that it considers invalid.
PiperOrigin-RevId: 381287141
diff --git a/http2/adapter/http2_visitor_interface.h b/http2/adapter/http2_visitor_interface.h
index 4250a5f..a707568 100644
--- a/http2/adapter/http2_visitor_interface.h
+++ b/http2/adapter/http2_visitor_interface.h
@@ -163,6 +163,12 @@
ssize_t* written,
bool* end_stream) = 0;
+ // Called when the connection receives an invalid frame. |error_code| is a
+ // negative integer error code generated by the library. A return value of
+ // false will result in the connection entering an error state, with no
+ // further frame processing possible.
+ virtual bool OnInvalidFrame(Http2StreamId stream_id, int error_code) = 0;
+
// Called when the connection is ready to write metadata for |stream_id| to
// the wire. The implementation should write at most |length| bytes of the
// serialized metadata payload to the |buffer| and set |written| to the number