curl-fuzzer C++ reference
Loading...
Searching...
No Matches
gopher_mock_server.h
Go to the documentation of this file.
1/*
2 * Copyright (C) Max Dymond, <cmeister2@gmail.com>, et al.
3 *
4 * SPDX-License-Identifier: curl
5 */
6
9
10#ifndef PROTO_FUZZER_GOPHER_MOCK_SERVER_H_
11#define PROTO_FUZZER_GOPHER_MOCK_SERVER_H_
12
13#include <memory>
14
16
17namespace proto_fuzzer {
18
21class GopherMockServer final : public MockServer {
22 public:
23 explicit GopherMockServer(curl::fuzzer::proto::GopherProbeMode mode);
24 ~GopherMockServer() override;
25
26 GopherMockServer(const GopherMockServer&) = delete;
27 GopherMockServer& operator=(const GopherMockServer&) = delete;
28
29 protected:
30 std::unique_ptr<MockConnection> CreateConnection() override;
31 void RunLoop(CURLM* multi, CURL* easy, const curl::fuzzer::proto::Scenario& scenario) override;
32
33 private:
34 const curl::fuzzer::proto::GopherProbeMode mode_;
35};
36
37} // namespace proto_fuzzer
38
39#endif // PROTO_FUZZER_GOPHER_MOCK_SERVER_H_
GopherMockServer(curl::fuzzer::proto::GopherProbeMode mode)
Construct a closed Gopher probe peer.
void RunLoop(CURLM *multi, CURL *easy, const curl::fuzzer::proto::Scenario &scenario) override
Apply the two fixed timing policies immediately before curl's first perform.
std::unique_ptr< MockConnection > CreateConnection() override
Build an ordinary socketpair, then saturate the client-to-server direction for the timeout probe befo...
MockServer(MultiDrivePolicy drive_policy=MultiDrivePolicy::kPerform)
Construct an idle MockServer with no scripted responses or open peers.
MockConnection and MockServer — the in-process peer that feeds canned response bytes to libcurl over ...