10#ifndef PROTO_FUZZER_MULTI_SOCKET_DRIVER_H_
11#define PROTO_FUZZER_MULTI_SOCKET_DRIVER_H_
19namespace proto_fuzzer {
48 CURLMcode
Start(
int* running_handles);
60 curl_socket_t socket = CURL_SOCKET_BAD;
61 int interest = CURL_POLL_NONE;
65 static int SocketCallback(CURL* easy, curl_socket_t socket,
int what,
void* user_data,
void* socket_data);
67 static int TimerCallback(CURLM* multi,
long timeout_ms,
void* user_data);
69 int UpdateSocket(curl_socket_t socket,
int what,
void* socket_data);
71 int UpdateTimer(
long timeout_ms);
73 Watch* FindWatch(curl_socket_t socket);
75 Watch* FindFreeWatch();
81 static constexpr std::size_t kMaxWatches = 16;
84 std::array<Watch, kMaxWatches> watches_;
87 bool watch_exhausted_;
88 std::uint64_t generation_;
CURLMcode Start(int *running_handles)
Start libcurl's socket state machine through the documented timeout pseudo-socket without waiting for...
bool Install(CURLM *multi)
Install socket/timer callbacks on a caller-owned multi before adding an easy handle.
MultiSocketDriver()
Construct detached callback state.
bool watch_exhausted() const
void ProbeControlApis()
Exercise the wakeup and timeout-query APIs from a valid live-multi state.
~MultiSocketDriver()
The owner deliberately destroys this after curl_multi_cleanup, so there is no callback deregistration...
DriveResult DriveReady(int *running_handles)
Run one bounded, non-blocking event-loop turn: poll the callback-provided watch set with a zero timeo...
Result from one non-blocking event-loop turn.
bool made_progress
True when an action ran or callback/handle state changed.
CURLMcode code
libcurl's result for the last socket action in the turn.