curl-fuzzer C++ reference
Loading...
Searching...
No Matches
pop3_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_POP3_MOCK_SERVER_H_
11#define PROTO_FUZZER_POP3_MOCK_SERVER_H_
12
13#include <string_view>
14
16
17namespace proto_fuzzer {
18
37class Pop3MockServer : public PingpongMockServer {
38 public:
40
41 ~Pop3MockServer() override;
42
43 void ObserveState() override;
44
45 Pop3MockServer(const Pop3MockServer&) = delete;
46 Pop3MockServer& operator=(const Pop3MockServer&) = delete;
47
48 protected:
49 void HandleLine(std::string_view line) override;
50
51 void QueueShutdownReply() override;
52
53 private:
55 static constexpr std::string_view kShutdownReply = "+OK mock closing POP3 connection\r\n";
56};
57
58} // namespace proto_fuzzer
59
60#endif // PROTO_FUZZER_POP3_MOCK_SERVER_H_
void QueueShutdownReply() override
Queue a +OK for the blocking QUIT that follows easy cleanup, then let the shared transport half-close...
void HandleLine(std::string_view line) override
Advance one reply for every complete command.
Pop3MockServer()
Begin without a borrowed protobuf or open socketpair.
~Pop3MockServer() override
Release the server-owned socketpair half after curl has returned its client descriptor.
void ObserveState() override
Retain protocol outcomes in coverage and introspector builds.
PingpongMockServer — shared line-oriented command/response transport for the mail-style protocol peer...