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

Exercises public easy/share/query APIs while preserving all caller- owned option and callback lifetimes. More...

#include <api_lifecycle.h>

Public Member Functions

 ApiLifecycle (CURL *easy, const curl::fuzzer::proto::ApiPlan &plan, std::string_view url)
 Configure the plan's share handle and cover public error-string tables.
 ApiLifecycle (CURL *easy, curl::fuzzer::proto::ApiPlan &&plan, std::string_view url)=delete
 A temporary plan cannot satisfy the retained reference's lifetime.
 ~ApiLifecycle ()
 RunScenario keeps this owner alive through easy cleanup, which releases even an incomplete connection's share reference before CleanupShare runs.
void ProbeTransferResults (bool probe_upkeep)
 Run correctly typed CURLINFO and response-header probes selected by the plan.
void ProbeEasyDuplication ()
 Duplicate, reset, and destroy a scratch easy handle while every pointer- valued option copied from the source still has a live owner.
bool response_pause_returned () const
std::size_t response_bytes_received () const
void SetActiveMulti (CURLM *multi)
 Hand the driving multi handle to the reentrancy probes so the multi-entry probes can target the live object.
std::size_t reentrant_probes_run () const
std::size_t reentrant_recursive_rejections () const
bool guessed_scheme_url () const
bool version_info_probed () const
bool https_proxy_feature_present () const

Detailed Description

Exercises public easy/share/query APIs while preserving all caller- owned option and callback lifetimes.

Construct this only after the easy handle has its final pre-transfer configuration. The owner must destroy the easy before this object: easy cleanup reliably releases its share reference even when an incomplete connection makes explicit detachment fail. Result and duplication probes remain explicit because they run before either teardown step.

Definition at line 34 of file api_lifecycle.h.

Constructor & Destructor Documentation

◆ ApiLifecycle()

proto_fuzzer::ApiLifecycle::ApiLifecycle ( CURL * easy,
const curl::fuzzer::proto::ApiPlan & plan,
std::string_view url )

Configure the plan's share handle and cover public error-string tables.

The plan is borrowed because RunScenario keeps its source Scenario alive and unmodified for this object's complete lifetime.

Parameters
easyLive easy handle used by explicit probes; clean it before destroying this lifecycle so its share reference is gone first.
planBounded API plan retained by the API target policy; it must remain alive and unmodified for this lifecycle's complete lifetime.
urlBounded scenario URL used by URL and escaping probes during construction; it is not retained.

Definition at line 409 of file api_lifecycle.cc.

Member Function Documentation

◆ guessed_scheme_url()

bool proto_fuzzer::ApiLifecycle::guessed_scheme_url ( ) const
Returns
True when the opt-in public URL probe inferred FTP successfully.

Definition at line 674 of file api_lifecycle.cc.

◆ https_proxy_feature_present()

bool proto_fuzzer::ApiLifecycle::https_proxy_feature_present ( ) const
Returns
Public HTTPS-proxy feature state observed by the version query.

Definition at line 680 of file api_lifecycle.cc.

◆ ProbeEasyDuplication()

void proto_fuzzer::ApiLifecycle::ProbeEasyDuplication ( )

Duplicate, reset, and destroy a scratch easy handle while every pointer- valued option copied from the source still has a live owner.

The duplicate inherits borrowed slists and callback userdata but not the source share. Reset it immediately, then cleanup; performing it would reuse mock/request cursors and test a harness artifact instead of libcurl's duplication lifecycle.

Definition at line 731 of file api_lifecycle.cc.

◆ ProbeTransferResults()

void proto_fuzzer::ApiLifecycle::ProbeTransferResults ( bool probe_upkeep)

Run correctly typed CURLINFO and response-header probes selected by the plan.

Call only after the transfer entrypoint has returned. The typed descriptor table suppresses duplicates whose only effect would be charging an iteration for the same immutable result. Header traversal remains unconditional in the API lane because it exposes a separate public API and is independently capped.

Parameters
probe_upkeepTrue only while curl_easy_perform's internal multi remains attached and can service curl_easy_upkeep safely.

Definition at line 690 of file api_lifecycle.cc.

◆ reentrant_probes_run()

std::size_t proto_fuzzer::ApiLifecycle::reentrant_probes_run ( ) const
Returns
number of public API probes fired from the response callback.

Definition at line 492 of file api_lifecycle.cc.

◆ reentrant_recursive_rejections()

std::size_t proto_fuzzer::ApiLifecycle::reentrant_recursive_rejections ( ) const
Returns
number of probes libcurl rejected with a recursive-API-call code.

Definition at line 495 of file api_lifecycle.cc.

◆ response_bytes_received()

std::size_t proto_fuzzer::ApiLifecycle::response_bytes_received ( ) const
Returns
response bytes accepted after the paused chunk was replayed.

Definition at line 482 of file api_lifecycle.cc.

◆ response_pause_returned()

bool proto_fuzzer::ApiLifecycle::response_pause_returned ( ) const
Returns
whether the API-plan response callback returned PAUSE once.

Definition at line 479 of file api_lifecycle.cc.

◆ SetActiveMulti()

void proto_fuzzer::ApiLifecycle::SetActiveMulti ( CURLM * multi)

Hand the driving multi handle to the reentrancy probes so the multi-entry probes can target the live object.

Called before the drive loop starts; null in easy-only drives, where multi probes are skipped.

Parameters
multiLive multi handle driving the transfer, or null in easy-only drives where multi probes are skipped.

Definition at line 489 of file api_lifecycle.cc.

◆ version_info_probed()

bool proto_fuzzer::ApiLifecycle::version_info_probed ( ) const
Returns
True when the opt-in version descriptor query returned data.

Definition at line 677 of file api_lifecycle.cc.


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