10#ifndef PROTO_FUZZER_TRANSFER_SESSION_H_
11#define PROTO_FUZZER_TRANSFER_SESSION_H_
18#include "curl_fuzzer.pb.h"
23namespace proto_fuzzer {
32class TransferSession {
37 TransferSession(
const TransferSession&) =
delete;
38 TransferSession& operator=(
const TransferSession&) =
delete;
39 TransferSession(TransferSession&&) =
delete;
40 TransferSession& operator=(TransferSession&&) =
delete;
46 void ApplyBaseline(
const curl::fuzzer::proto::Scenario& scenario);
61 bool apply_resolve_entries =
false);
74 std::unique_ptr<ParserInputs> parser_inputs_;
77 std::unique_ptr<ApiLifecycle> api_lifecycle_;
79 std::optional<ScenarioRequestData> request_data_;
Exercises public easy/share/query APIs while preserving all caller- owned option and callback lifetim...
Builds HTTP headers or TELNET options, MIME state, and upload callbacks whose storage or userdata lib...
bool Initialize()
Allocate the easy lazily so unused concurrent-transfer slots stay empty.
CURL * easy() const
Borrow the owned easy; callers must not clean it themselves.
const char * FileSourcePath() const
Return the pathname of the prepared FILE source/sink.
void ApplyInputFiles()
Apply prepared parser paths after baseline and peer installation.
ScenarioRequestData * InstallRequestData(const curl::fuzzer::proto::Scenario &scenario, bool apply_resolve_entries=false)
Install owned request attachments.
void Close()
Release all resources in their required order. Safe to call repeatedly.
bool ResetConfiguration()
Reset pre-transfer configuration while preserving prepared parser files.
void ConfigureAltSvcRouting(const std::string &host_path)
Enable isolated Alt-Svc routing for the canonical deep-HTTP authority.
void ApplyPinnedPublicKeyFile()
Install the prepared public-key pin path after generic scalar options.
void ApplyBaseline(const curl::fuzzer::proto::Scenario &scenario)
Apply baseline options and retain their CONNECT_TO storage.
bool PrepareInputFiles(const curl::fuzzer::proto::Scenario &scenario, ScenarioRunMode mode)
Copy bounded parser inputs into lazily allocated anonymous files.
ApiLifecycle * InstallApiLifecycle(const curl::fuzzer::proto::ApiPlan &plan, std::string_view url)
Install API/share state that survives easy cleanup.
Common ownership types for independently cleaned-up curl handles.
std::unique_ptr< curl_slist, CurlSlistDeleter > CurlSlistPtr
Unique ownership of a caller-owned curl_slist.
std::unique_ptr< CURL, CurlEasyDeleter > CurlEasyPtr
Unique ownership of a CURL easy handle.
Owns pointer-valued HTTP headers, TELNET options, MIME state, and upload callback state derived from ...
Compile-time identities and execution modes for proto fuzz targets.
ScenarioRunMode
Selects one of the complete, valid RunScenario behaviours.