curl-fuzzer C++ reference
Loading...
Searching...
No Matches
proto_fuzzer::InterfaceOptionMockServer Class Referencefinal

Real-loopback variant used only for interface binding and TCP keepalive. More...

#include <proxy_option_mock_server.h>

Inheritance diagram for proto_fuzzer::InterfaceOptionMockServer:
proto_fuzzer::HappyEyeballsMockServer proto_fuzzer::MockServerBase

Public Member Functions

void Install (CURL *easy) override
 Install the inherited owned loopback TCP listener, then require curl to perform its normal INET setup with a fixed local bind and keepalive policy.
Public Member Functions inherited from proto_fuzzer::HappyEyeballsMockServer
 HappyEyeballsMockServer ()
 Construct an idle peer with no listener or accepted connections.
 ~HappyEyeballsMockServer () override
 Release listeners and accepted loopback peers.
void ConfigureRequestData (ScenarioRequestData *request_data) override
 Replace the resolver lane's single-address mapping with a two-address entry for the fixed canonical host and point the URL's effective port at the ephemeral listener.
std::size_t opened_socket_count () const
std::size_t accepted_peer_count () const
int listener_port () const
Public Member Functions inherited from proto_fuzzer::MockServerBase
virtual ~MockServerBase ()
 Out-of-line destructor so MockConnection can stay forward-declared in the base header (its complete type is only needed where unique_ptr is instantiated for destruction).
virtual void ObserveState ()
 Default no-op for peers without protocol-specific observations.
CURLcode DriveScenario (CURL *easy, const curl::fuzzer::proto::Scenario &scenario)
 Run 'scenario' to completion on 'easy': allocate a multi, attach 'easy', delegate protocol-specific work to RunLoop, consume its completion message, and clean up.
virtual CURLcode DriveEasyScenario (CURL *easy, const curl::fuzzer::proto::Scenario &scenario, bool use_events=false)
 Run through the public easy entrypoint when a protocol mock can preload all peer work before curl takes control.
virtual ConnectOnlyRunStats DriveConnectOnlyScenario (CURL *easy, const curl::fuzzer::proto::Scenario &scenario)
 Establish a CONNECT_ONLY transport, then perform bounded direct I/O.
void SetMultiObserver (MultiObserver observer)
 Register an observer invoked with the live multi handle after 'easy' is attached and before the drive loop starts.
MockConnection * connection ()

Additional Inherited Members

Public Types inherited from proto_fuzzer::MockServerBase
using MultiObserver = std::function<void(CURLM*)>
 Callback type used to publish the driving multi handle to observers.
Protected Member Functions inherited from proto_fuzzer::HappyEyeballsMockServer
curl_socket_t HandleOpenSocket (curlsocktype purpose, struct curl_sockaddr *address) override
 Hand curl a fresh unconnected socket for every address its happy-eyeballs filter decides to race.
SocketSetupDisposition GetSocketSetupDisposition (curl_socket_t curlfd, curlsocktype purpose) const override
 Stream peers must follow curl's ordinary connect path; unlike the socketpair mocks, the descriptor is deliberately not connected yet.
void RunLoop (CURLM *multi, CURL *easy, const curl::fuzzer::proto::Scenario &scenario) override
 Run a bounded perform loop that also accepts real loopback connections and serves their response scripts.
Protected Member Functions inherited from proto_fuzzer::MockServerBase
 MockServerBase (MultiDrivePolicy drive_policy=MultiDrivePolicy::kPerform)
 Construct an empty base instance with a fixed multi-drive policy.
virtual void HandleDetachedMulti (CurlMultiPtr multi)
 Dispose of or retain the multi after its easy handle has been removed.
MultiSocketDriver * multi_socket_driver ()
 Expose the callback state installed for the current socket-action drive.
std::size_t additional_handle_cleanup_count () const
void ResumeResponseIfRequested (CURL *easy)
 Resume receive-side callback output at one bounded drive boundary when the dedicated API plan requested it.
void ApplyPendingBackpressure ()
 Apply the BackpressureConfig cached by DriveScenario to the new connection_.
Static Protected Member Functions inherited from proto_fuzzer::MockServerBase
static int WaitOnMultiFdset (CURLM *multi, CURLMcode *rc)
 Wait on curl's fdset with a short timeout.
static void ProbeMultiPollset (CURLM *multi)
 Ask curl to construct and inspect its connection-filter pollset without waiting.
static bool MultiPollsetWantsWrite (CURLM *multi, curl_socket_t socket)
 Inspect one socket's current writable interest through curl's public multi fdset API.
static bool UsesTimedDrive (const curl::fuzzer::proto::Scenario &scenario)
 Treat a non-default BackpressureConfig as an explicit request for the slower, timed drive policy.
Protected Attributes inherited from proto_fuzzer::MockServerBase
std::unique_ptr< MockConnection > connection_
 The per-scenario MockConnection, lazily created by HandleOpenSocket().
int pending_recv_buf_bytes_
 Cached SO_RCVBUF/SO_SNDBUF setting in bytes.
std::size_t pending_drain_limit_
 Cached per-call DrainIncoming byte budget.
MultiSocketDriver * multi_socket_driver_
 Non-owning pointer into DriveScenario's stack.
std::size_t additional_handle_cleanup_count_
 Number of application-created handles, excluding the caller's parent, successfully removed from the current multi and cleaned up.
bool resume_response_
 True only for an API-plan multi drive with its one-shot write callback.
MultiObserver multi_observer_
 Observer receiving the live multi handle at the start of a drive.
Static Protected Attributes inherited from proto_fuzzer::MockServerBase
static constexpr int kMaxDriveIterations = 512
 Hard operation budget for one scenario.
static constexpr int kMaxIdleIterations = 8
 Consecutive no-progress budget for ordinary scenarios.
static constexpr int kMaxTimedIdleIterations = 256
 Explicit backpressure scenarios get a larger idle budget and may use the short timed wait above.

Detailed Description

Real-loopback variant used only for interface binding and TCP keepalive.

It inherits the bounded listener, destination validation, accept budget, and response driver from the resolver lane's loopback TCP peer.

Definition at line 67 of file proxy_option_mock_server.h.

Member Function Documentation

◆ Install()

void proto_fuzzer::InterfaceOptionMockServer::Install ( CURL * easy)
overridevirtual

Install the inherited owned loopback TCP listener, then require curl to perform its normal INET setup with a fixed local bind and keepalive policy.

Parameters
easyEasy handle to configure.

Reimplemented from proto_fuzzer::HappyEyeballsMockServer.

Definition at line 151 of file proxy_option_mock_server.cc.


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