curl-fuzzer C++ reference
Loading...
Searching...
No Matches
proto_fuzzer::H2Runtime Class Reference

Protocol state shared by TLS and plaintext HTTP/2 origin peers. More...

#include <h2_runtime.h>

Public Member Functions

 H2Runtime ()
 Construct detached protocol state without observing a connection.
void PrepareMulti (CURLM *multi, bool accept_push)
 Install the bounded push policy before curl emits its initial SETTINGS.
void AttachConnection (MockConnection *connection)
 Observe application bytes after the carrier has decoded its transport.
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.
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.
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
std::size_t push_header_count () const
bool saw_push_path () const
std::size_t accepted_push_count () const
std::size_t pushed_body_bytes () const
CURLcode upkeep_result () const
std::size_t observed_request_count () const
std::size_t observed_client_settings_count () const
std::size_t observed_client_priority_count () const
bool post_headers_transition_applied () const
CURLcode stream_weight_setopt_result () const
CURLcode stream_weight_egress_result () const
void ApplyPostHeadersTransition (CURL *easy)
 Apply the plan's one state transition only after a real request stream has been observed.

Detailed Description

Protocol state shared by TLS and plaintext HTTP/2 origin peers.

This object owns the client-frame observer and push callback userdata, but borrows the transport and curl handles. The carrier must destroy its retained multi and observed connections before destroying this runtime.

Definition at line 33 of file h2_runtime.h.

Member Function Documentation

◆ accepted_push_count()

std::size_t proto_fuzzer::H2Runtime::accepted_push_count ( ) const
Returns
Number of pushed transfers accepted in the most recent drive.

Definition at line 166 of file h2_runtime.cc.

◆ ApplyPostHeadersTransition()

void proto_fuzzer::H2Runtime::ApplyPostHeadersTransition ( CURL * easy)

Apply the plan's one state transition only after a real request stream has been observed.

Changing the public option at this point makes curl compare the desired weight against the live stream's effective weight.

Parameters
easyActive easy handle whose live stream weight is changed.

Definition at line 72 of file h2_runtime.cc.

◆ AttachConnection()

void proto_fuzzer::H2Runtime::AttachConnection ( MockConnection * connection)

Observe application bytes after the carrier has decoded its transport.

A null connection is harmless; an attached connection borrows this runtime.

Parameters
connectionTransport to observe, or nullptr when creation failed.

Definition at line 50 of file h2_runtime.cc.

◆ DrivePlan()

void proto_fuzzer::H2Runtime::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.

Carrier observation and response-resume work run after each successful perform through the hook. Idle and operation limits remain selected by the owning driver.

Parameters
multiCaller-owned multi handle containing the transfer to drive.
serverCarrier exposing the currently active connection.
max_idle_iterationsConsecutive no-progress turns allowed.
max_drive_iterationsTotal state-machine turns allowed.
after_performCarrier hook invoked after each successful perform.

Definition at line 95 of file h2_runtime.cc.

◆ FinishTransfer()

void proto_fuzzer::H2Runtime::FinishTransfer ( CURL * easy,
MockConnection * connection )

Probe upkeep while curl's connection cache and the peer are still live.

Parameters
easyCaller-owned easy handle whose upkeep API is probed.
connectionPeer to drain after upkeep, or nullptr when none opened.

Definition at line 133 of file h2_runtime.cc.

◆ observed_client_priority_count()

std::size_t proto_fuzzer::H2Runtime::observed_client_priority_count ( ) const
Returns
PRIORITY frames observed in curl's client byte stream.

Definition at line 181 of file h2_runtime.cc.

◆ observed_client_settings_count()

std::size_t proto_fuzzer::H2Runtime::observed_client_settings_count ( ) const
Returns
Non-ACK client SETTINGS frames observed since the latest plan reset.

Definition at line 178 of file h2_runtime.cc.

◆ observed_request_count()

std::size_t proto_fuzzer::H2Runtime::observed_request_count ( ) const
Returns
Number of request streams observed since the latest plan reset.

Definition at line 175 of file h2_runtime.cc.

◆ post_headers_transition_applied()

bool proto_fuzzer::H2Runtime::post_headers_transition_applied ( ) const
Returns
Whether request observation triggered the configured transition.

Definition at line 184 of file h2_runtime.cc.

◆ PrepareMulti()

void proto_fuzzer::H2Runtime::PrepareMulti ( CURLM * multi,
bool accept_push )

Install the bounded push policy before curl emits its initial SETTINGS.

The runtime must outlive the multi and any accepted pushed handles.

Parameters
multiCaller-owned multi handle receiving the push callbacks.
accept_pushWhether to accept one push and reject further pushes.

Definition at line 38 of file h2_runtime.cc.

◆ push_callback_count()

std::size_t proto_fuzzer::H2Runtime::push_callback_count ( ) const
Returns
Number of syntactically valid pushes offered to this runtime.

Definition at line 157 of file h2_runtime.cc.

◆ push_header_count()

std::size_t proto_fuzzer::H2Runtime::push_header_count ( ) const
Returns
Number of PUSH_PROMISE headers advertised to the push callback.

Definition at line 160 of file h2_runtime.cc.

◆ pushed_body_bytes()

std::size_t proto_fuzzer::H2Runtime::pushed_body_bytes ( ) const
Returns
Body bytes consumed from accepted pushes in the latest drive.

Definition at line 169 of file h2_runtime.cc.

◆ ResetPlan()

void proto_fuzzer::H2Runtime::ResetPlan ( const curl::fuzzer::proto::Http2Plan & plan,
std::string scheme,
std::string authority = "tls.test" )

Borrow a structured plan for the ensuing synchronous drive.

Parameters
planStable plan that remains alive and unmodified during the drive.
schemeScheme used in generated push-request pseudo-headers.
authorityAuthority used in generated push-request pseudo-headers.

Definition at line 60 of file h2_runtime.cc.

◆ saw_push_path()

bool proto_fuzzer::H2Runtime::saw_push_path ( ) const
Returns
True when the latest push callback found the promised :path.

Definition at line 163 of file h2_runtime.cc.

◆ stream_weight_egress_result()

CURLcode proto_fuzzer::H2Runtime::stream_weight_egress_result ( ) const
Returns
Result of the public resume used as the deterministic egress edge.

Definition at line 190 of file h2_runtime.cc.

◆ stream_weight_setopt_result()

CURLcode proto_fuzzer::H2Runtime::stream_weight_setopt_result ( ) const
Returns
Result of the live CURLOPT_STREAM_WEIGHT update.

Definition at line 187 of file h2_runtime.cc.

◆ upkeep_result()

CURLcode proto_fuzzer::H2Runtime::upkeep_result ( ) const
Returns
Result of the most recent upkeep probe, or CURLE_FAILED_INIT.

Definition at line 172 of file h2_runtime.cc.


The documentation for this class was generated from the following files: