10#ifndef PROTO_FUZZER_IMAP_MOCK_SERVER_H_
11#define PROTO_FUZZER_IMAP_MOCK_SERVER_H_
19namespace proto_fuzzer {
62 void HandleLine(std::string_view line)
override;
72 static constexpr std::string_view kShutdownTail =
" OK LOGOUT completed\r\n";
75 std::string RewriteReply(std::string_view response)
const;
78 static bool StatusLineNeedsTag(std::string_view line);
81 bool ResponseHasTaggedCompletion(std::string_view response)
const;
84 static bool ResponseHasContinuation(std::string_view response);
87 static std::size_t LiteralSize(std::string_view line);
90 static std::size_t AppendLiteralSize(std::string_view command);
93 std::string NextCommandTag()
const;
96 std::string current_tag_;
100 bool authentication_continuation_active_ =
false;
void ObserveState() override
Retain protocol outcomes in coverage and introspector builds.
void HandleLine(std::string_view line) override
Advance one reply for every complete command or AUTHENTICATE continuation.
void QueueShutdownReply() override
Queue a tagged completion for curl's blocking LOGOUT during teardown.
~ImapMockServer() override
Release the server-owned socketpair half after curl has returned its client descriptor.
void ResetProtocolState() override
Clear the tag remembered from the previous drive.
ImapMockServer()
Begin without a borrowed protobuf or open socketpair.
PingpongMockServer — shared line-oriented command/response transport for the mail-style protocol peer...