Squid Web Cache master
Loading...
Searching...
No Matches
ResponseParser.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SRC_HTTP_ONE_RESPONSEPARSER_H
10#define SQUID_SRC_HTTP_ONE_RESPONSEPARSER_H
11
12#include "http/one/Parser.h"
13#include "http/StatusCode.h"
14
15namespace Http {
16namespace One {
17
30{
31public:
32 ResponseParser() = default;
33 ResponseParser(const ResponseParser &) = default;
37 ~ResponseParser() override {}
38
39 /* Http::One::Parser API */
40 void clear() override {*this=ResponseParser();}
41 Http1::Parser::size_type firstLineSize() const override;
42 bool parse(const SBuf &aBuf) override;
43
44 /* response specific fields, read-only */
46 SBuf reasonPhrase() const { return reasonPhrase_;}
47
51 static void ParseResponseStatus(Tokenizer &, StatusCode &code);
52
53private:
56
58 static const SBuf IcyMagic;
59
62 bool completedStatus_ = false;
63
66
69};
70
71} // namespace One
72} // namespace Http
73
74#endif /* SQUID_SRC_HTTP_ONE_RESPONSEPARSER_H */
75
::Parser::Tokenizer Tokenizer
Definition Parser.h:44
SBuf reasonPhrase_
HTTP/1 status-line reason phrase.
Http::StatusCode messageStatus() const
ResponseParser(const ResponseParser &)=default
Http::StatusCode statusCode_
HTTP/1 status-line status code.
int parseResponseStatusAndReason(Tokenizer &)
static void ParseResponseStatus(Tokenizer &, StatusCode &code)
Http1::Parser::size_type firstLineSize() const override
size in bytes of the first line including CRLF terminator
ResponseParser & operator=(const ResponseParser &)=default
ResponseParser(ResponseParser &&)=default
static const SBuf IcyMagic
magic prefix for identifying ICY response messages
bool parse(const SBuf &aBuf) override
Definition SBuf.h:94
Definition forward.h:18
StatusCode
Definition StatusCode.h:20
@ scNone
Definition StatusCode.h:21