ResponseParser.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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 
15 namespace Http {
16 namespace One {
17 
30 {
31 public:
32  ResponseParser() = default;
33  ResponseParser(const ResponseParser &) = default;
34  ResponseParser &operator =(const ResponseParser &) = default;
35  ResponseParser(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  /* respone specific fields, read-only */
46  SBuf reasonPhrase() const { return reasonPhrase_;}
47 
52 
53 private:
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 
@ scNone
Definition: StatusCode.h:21
Definition: SBuf.h:93
ResponseParser & operator=(const ResponseParser &)=default
StatusCode
Definition: StatusCode.h:20
Definition: forward.h:17
bool parse(const SBuf &aBuf) override
SBuf::size_type size_type
Definition: Parser.h:43
static void ParseResponseStatus(Tokenizer &, StatusCode &code)
SBuf reasonPhrase_
HTTP/1 status-line reason phrase.
int code
Definition: smb-errors.c:145
Http1::Parser::size_type firstLineSize() const override
size in bytes of the first line including CRLF terminator
static const SBuf IcyMagic
magic prefix for identifying ICY response messages
Http::StatusCode statusCode_
HTTP/1 status-line status code.
Http::StatusCode messageStatus() const
::Parser::Tokenizer Tokenizer
Definition: Parser.h:44
int parseResponseStatusAndReason(Tokenizer &)

 

Introduction

Documentation

Support

Miscellaneous