10#ifndef PROTO_FUZZER_H2_RUNTIME_H_
11#define PROTO_FUZZER_H2_RUNTIME_H_
22struct curl_pushheaders;
24namespace proto_fuzzer {
44 void ResetPlan(
const curl::fuzzer::proto::Http2Plan& plan, std::string scheme, std::string authority =
"tls.test");
46 void ResetPlan(curl::fuzzer::proto::Http2Plan&&, std::string, std::string =
"tls.test") =
delete;
47 void ResetPlan(
const curl::fuzzer::proto::Http2Plan&&, std::string, std::string =
"tls.test") =
delete;
49 void DrivePlan(CURLM* multi,
MockServer& server,
int max_idle_iterations,
int max_drive_iterations,
50 const std::function<
void()>& after_perform);
70 static int PushCallback(CURL* parent, CURL* pushed, std::size_t header_count,
struct curl_pushheaders* headers,
72 static std::size_t PushedWriteCallback(
char* contents, std::size_t size, std::size_t nmemb,
void* userdata);
75 std::size_t push_callback_count_ = 0;
76 std::size_t push_header_count_ = 0;
77 bool saw_push_path_ =
false;
78 bool accept_push_ =
false;
79 std::size_t accepted_push_count_ = 0;
80 std::size_t pushed_body_bytes_ = 0;
81 CURLcode upkeep_result_ = CURLE_FAILED_INIT;
82 std::uint32_t stream_weight_after_headers_ = 0;
83 bool post_headers_transition_applied_ =
false;
84 CURLcode stream_weight_setopt_result_ = CURLE_FAILED_INIT;
85 CURLcode stream_weight_egress_result_ = CURLE_FAILED_INIT;
Converts Http2Plan actions to correlated wire frames while tracking the request streams observed from...
bool post_headers_transition_applied() const
H2Runtime()
Construct detached protocol state without observing a connection.
std::size_t observed_request_count() const
void FinishTransfer(CURL *easy, MockConnection *connection)
Probe upkeep while curl's connection cache and the peer are still live.
std::size_t push_callback_count() const
void ResetPlan(const curl::fuzzer::proto::Http2Plan &plan, std::string scheme, std::string authority="tls.test")
Borrow a structured plan for the ensuing synchronous drive.
std::size_t observed_client_priority_count() const
void AttachConnection(MockConnection *connection)
Observe application bytes after the carrier has decoded its transport.
std::size_t accepted_push_count() const
CURLcode stream_weight_setopt_result() const
std::size_t observed_client_settings_count() const
void ApplyPostHeadersTransition(CURL *easy)
Apply the plan's one state transition only after a real request stream has been observed.
CURLcode stream_weight_egress_result() const
CURLcode upkeep_result() const
void DrivePlan(CURLM *multi, MockServer &server, int max_idle_iterations, int max_drive_iterations, const std::function< void()> &after_perform)
Alternate curl and one bounded H2 plan boundary.
std::size_t push_header_count() const
void PrepareMulti(CURLM *multi, bool accept_push)
Install the bounded push policy before curl emits its initial SETTINGS.
std::size_t pushed_body_bytes() const
bool saw_push_path() const
Owns one half of a socketpair used to feed canned responses to libcurl.
Orchestrates a bounded sequence of mock HTTP exchanges: installs socket callbacks on an easy handle,...
Stateful serializer for structured HTTP/2 peer actions.