]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/HttpStatusLine.h
5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
31 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
33 #ifndef SQUID_HTTPSTATUSLINE_H
34 #define SQUID_HTTPSTATUSLINE_H
39 #include "HttpStatusCode.h"
40 #include "HttpVersion.h"
41 #include "anyp/ProtocolType.h"
42 #include "SquidString.h"
45 * Holds the values parsed from an HTTP reply status line.
47 * For example: HTTP/1.1 200 Okay
52 /* public, read only */
55 * By rights protocol name should be a constant "HTTP", with no need for this field to exist.
56 * However there are protocols which violate HTTP by sending their own custom formats
57 * back with other protocol names (ICY streaming format being the current major problem).
59 AnyP::ProtocolType protocol
;
61 HttpVersion version
; ///< breakdown of protocol version labels: 0.9 1.0 1.1
62 http_status status
; ///< status code. ie 200 404
63 const char *reason
; ///< points to a _constant_ string (default or supplied), never free()d */
67 SQUIDCEXTERN
void httpStatusLineInit(HttpStatusLine
* sline
);
68 SQUIDCEXTERN
void httpStatusLineClean(HttpStatusLine
* sline
);
70 SQUIDCEXTERN
void httpStatusLineSet(HttpStatusLine
* sline
, HttpVersion version
,
71 http_status status
, const char *reason
);
72 SQUIDCEXTERN
const char *httpStatusLineReason(const HttpStatusLine
* sline
);
74 /* parse a 0-terminating buffer and fill internal structires; returns true on success */
75 SQUIDCEXTERN
int httpStatusLineParse(HttpStatusLine
* sline
, const String
&protoPrefix
,
76 const char *start
, const char *end
);
77 /* pack fields using Packer */
78 SQUIDCEXTERN
void httpStatusLinePackInto(const HttpStatusLine
* sline
, Packer
* p
);
80 SQUIDCEXTERN
const char *httpStatusString(http_status status
);
83 #endif /* SQUID_HTTPSTATUSLINE_H */