StatusLine.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_HTTP_STATUSLINE_H
10#define SQUID_HTTP_STATUSLINE_H
11
13#include "http/StatusCode.h"
14#include "SquidString.h"
15
16class Packable;
17class String;
18
19namespace Http
20{
21
28{
29public:
31 void init();
32
34 void clean();
35
39 void set(const AnyP::ProtocolVersion &newVersion, Http::StatusCode newStatus, const char *newReason = nullptr);
40
42 void resetReason() { reason_ = nullptr; }
43
45 Http::StatusCode status() const { return status_; }
46
48 const char *reason() const;
49
51 void packInto(Packable *) const;
52
57 bool parse(const String &protoPrefix, const char *start, const char *end);
58
59public:
60 /* public, read only */
61
63
64private:
67
69 const char *reason_ = nullptr;
70};
71
72} // namespace Http
73
74#endif /* SQUID_HTTP_STATUSLINE_H */
75
bool parse(const String &protoPrefix, const char *start, const char *end)
Definition: StatusLine.cc:86
void init()
reset this status-line back to empty state
Definition: StatusLine.cc:22
void clean()
reset this status-line back to Internal Server Error state
Definition: StatusLine.cc:28
void packInto(Packable *) const
pack fields into a Packable object
Definition: StatusLine.cc:50
AnyP::ProtocolVersion version
breakdown of protocol version label: (HTTP/ICY) and (0.9/1.0/1.1)
Definition: StatusLine.h:62
void resetReason()
reset the reason phrase to its default status code-derived value
Definition: StatusLine.h:42
Http::StatusCode status_
status code. ie 100 ... 200 ... 404 ... 599
Definition: StatusLine.h:66
void set(const AnyP::ProtocolVersion &newVersion, Http::StatusCode newStatus, const char *newReason=nullptr)
Definition: StatusLine.cc:35
const char * reason_
points to a constant string (default or supplied), never free()d
Definition: StatusLine.h:69
const char * reason() const
retrieve the reason string for this status line
Definition: StatusLine.cc:44
Http::StatusCode status() const
retrieve the status code for this status line
Definition: StatusLine.h:45
Definition: forward.h:22
StatusCode
Definition: StatusCode.h:20
@ scNone
Definition: StatusCode.h:21

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors