curl-fuzzer C++ reference
Loading...
Searching...
No Matches
websocket_mock_server.h File Reference

WebSocketMockServer — an in-process WebSocket peer that drives a dynamic 101 handshake and then feeds RFC 6455 frame bytes to libcurl. More...

Go to the source code of this file.

Classes

class  proto_fuzzer::WebSocketMockServer
 In-process WebSocket peer. More...

Functions

bool proto_fuzzer::ScenarioRequestsManualWsDrive (const curl::fuzzer::proto::Scenario &scenario)
 Mirror the sequential CURLOPT_CONNECT_ONLY setopts applied by ApplyScenarioOptions.

Detailed Description

WebSocketMockServer — an in-process WebSocket peer that drives a dynamic 101 handshake and then feeds RFC 6455 frame bytes to libcurl.

Definition in file websocket_mock_server.h.

Function Documentation

◆ ScenarioRequestsManualWsDrive()

bool proto_fuzzer::ScenarioRequestsManualWsDrive ( const curl::fuzzer::proto::Scenario & scenario)

Mirror the sequential CURLOPT_CONNECT_ONLY setopts applied by ApplyScenarioOptions.

Values above 2 are rejected by libcurl and therefore cannot replace the last accepted setting. Use the same descriptor-aware scalar decoder as ApplySetOption so compatibility inputs and cross-family mutations cannot make curl and its mock disagree about manual delivery. Restricting the scan to RuntimeOptionCount also prevents a compatibility- only suffix from changing mock delivery after curl stops observing options.

Parameters
scenarioStructured input whose retained option prefix is inspected.
Returns
True when the final accepted CONNECT_ONLY value is 2.

Definition at line 176 of file websocket_mock_server.cc.