~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to src/HttpHeader.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2009-09-24 14:51:06 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (20.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090924145106-38jgrzmj0d73pha5
Tags: 3.1.0.13-1
* Upload to experimental

* New upstream release
  - Fixes Follow-X-Forwarded-For support (Closes: #523943)
  - Adds IPv6 support (Closes: #432351)

* debian/rules
  - Removed obsolete configuration options
  - Enable db and radius basic authentication modules

* debian/patches/01-cf.data.debian
  - Adapted to new upstream version

* debian/patches/02-makefile-defaults
  - Adapted to new upstream version

* debian/{squid.postinst,squid.rc,README.Debian,watch}
  - Updated references to squid 3.1

* debian/squid3.install
  - Install CSS file for error pages
  - Install manual pages for new authentication modules

* debian/squid3-common.install
  - Install documented version of configuration file in /usr/share/doc/squid3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
1
/*
3
 
 * $Id: HttpHeader.h,v 1.24.2.1 2008/02/27 05:59:29 amosjeffries Exp $
 
2
 * $Id$
4
3
 *
5
4
 *
6
5
 * SQUID Web Proxy Cache          http://www.squid-cache.org/
19
18
 *  it under the terms of the GNU General Public License as published by
20
19
 *  the Free Software Foundation; either version 2 of the License, or
21
20
 *  (at your option) any later version.
22
 
 *  
 
21
 *
23
22
 *  This program is distributed in the hope that it will be useful,
24
23
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
25
24
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
25
 *  GNU General Public License for more details.
27
 
 *  
 
26
 *
28
27
 *  You should have received a copy of the GNU General Public License
29
28
 *  along with this program; if not, write to the Free Software
30
29
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
34
33
#ifndef SQUID_HTTPHEADER_H
35
34
#define SQUID_HTTPHEADER_H
36
35
 
37
 
/* forward decls */
38
 
 
39
 
class CacheManager;
40
36
/* because we pass a spec by value */
41
37
#include "HttpHeaderRange.h"
42
38
/* HttpHeader holds a HttpHeaderMask */
43
39
#include "HttpHeaderMask.h"
44
40
 
 
41
 
 
42
/* class forward declarations */
 
43
class HttpVersion;
 
44
class HttpHdrContRange;
 
45
class HttpHdrCc;
 
46
class HttpHdrSc;
 
47
class HttpHdrRange;
 
48
class String;
 
49
 
 
50
 
45
51
/* constant attributes of http header fields */
46
52
 
47
 
/* recognized or "known" header fields; @?@ add more! */
 
53
/** recognized or "known" header fields; @?@ add more! */
48
54
typedef enum {
49
55
    HDR_BAD_HDR = -1,
50
56
    HDR_ACCEPT = 0,
87
93
    HDR_PROXY_AUTHENTICATION_INFO,
88
94
    HDR_PROXY_AUTHORIZATION,
89
95
    HDR_PROXY_CONNECTION,
 
96
    HDR_PROXY_SUPPORT,
90
97
    HDR_PUBLIC,
91
98
    HDR_RANGE,
92
 
    HDR_REQUEST_RANGE,          /* some clients use this, sigh */
 
99
    HDR_REQUEST_RANGE,          /**< some clients use this, sigh */
93
100
    HDR_REFERER,
94
101
    HDR_RETRY_AFTER,
95
102
    HDR_SERVER,
108
115
    HDR_WWW_AUTHENTICATE,
109
116
    HDR_AUTHENTICATION_INFO,
110
117
    HDR_X_CACHE,
111
 
    HDR_X_CACHE_LOOKUP,         /* tmp hack, remove later */
 
118
    HDR_X_CACHE_LOOKUP,         /**< tmp hack, remove later */
112
119
    HDR_X_FORWARDED_FOR,
113
 
    HDR_X_REQUEST_URI,          /* appended if ADD_X_REQUEST_URI is #defined */
 
120
    HDR_X_REQUEST_URI,          /**< appended if ADD_X_REQUEST_URI is #defined */
114
121
    HDR_X_SQUID_ERROR,
115
122
    HDR_NEGOTIATE,
116
123
#if X_ACCELERATOR_VARY
117
124
    HDR_X_ACCELERATOR_VARY,
118
125
#endif
 
126
#if USE_ADAPTATION
 
127
    HDR_X_NEXT_SERVICES,
 
128
#endif
119
129
    HDR_SURROGATE_CAPABILITY,
120
130
    HDR_SURROGATE_CONTROL,
121
131
    HDR_FRONT_END_HTTPS,
123
133
    HDR_ENUM_END
124
134
} http_hdr_type;
125
135
 
126
 
/* possible types for http header fields */
 
136
/** possible types for http header fields */
127
137
typedef enum {
128
 
    ftInvalid = HDR_ENUM_END,   /* to catch nasty errors with hdr_id<->fld_type clashes */
 
138
    ftInvalid = HDR_ENUM_END,   /**< to catch nasty errors with hdr_id<->fld_type clashes */
129
139
    ftInt,
130
140
    ftInt64,
131
141
    ftStr,
138
148
    ftDate_1123_or_ETag
139
149
} field_type;
140
150
 
141
 
/* possible owners of http header */
 
151
/** Possible owners of http header */
142
152
typedef enum {
143
153
    hoNone =0,
144
154
#if USE_HTCP
148
158
    hoReply
149
159
} http_hdr_owner_type;
150
160
 
151
 
struct _HttpHeaderFieldAttrs
152
 
{
 
161
struct _HttpHeaderFieldAttrs {
153
162
    const char *name;
154
163
    http_hdr_type id;
155
164
    field_type type;
156
165
};
157
166
 
158
 
class HttpVersion;
159
 
 
160
 
class HttpHdrContRange;
161
 
 
162
 
class HttpHdrCc;
163
 
 
164
 
class HttpHdrSc;
165
 
 
166
 
/*iteration for headers; use HttpHeaderPos as opaque type, do not interpret */
 
167
 
 
168
/** Iteration for headers; use HttpHeaderPos as opaque type, do not interpret */
167
169
typedef ssize_t HttpHeaderPos;
168
170
 
169
171
/* use this and only this to initialize HttpHeaderPos */
171
173
 
172
174
/* these two are defined in  structs.h */
173
175
 
 
176
/// \todo CLEANUP: Kill this.
174
177
typedef struct _TimeOrTag TimeOrTag;
175
178
 
 
179
/// \todo CLEANUP: Kill this.
176
180
typedef struct _ETag ETag;
177
181
 
178
182
class HttpHeaderEntry
192
196
    String value;
193
197
};
194
198
 
195
 
MEMPROXY_CLASS_INLINE(HttpHeaderEntry)
 
199
MEMPROXY_CLASS_INLINE(HttpHeaderEntry);
196
200
 
197
201
class HttpHeader
198
202
{
250
254
    int hasListMember(http_hdr_type id, const char *member, const char separator) const;
251
255
    int hasByNameListMember(const char *name, const char *member, const char separator) const;
252
256
    void removeHopByHopEntries();
 
257
 
 
258
    /* protected, do not use these, use interface functions instead */
 
259
    Vector<HttpHeaderEntry *> entries;          /**< parsed fields in raw format */
 
260
    HttpHeaderMask mask;        /**< bit set <=> entry present */
 
261
    http_hdr_owner_type owner;  /**< request or reply */
 
262
    int len;                    /**< length when packed, not counting terminating null-byte */
 
263
 
 
264
protected:
 
265
    /** \deprecated Public access replaced by removeHopByHopEntries() */
253
266
    void removeConnectionHeaderEntries();
254
 
    /* protected, do not use these, use interface functions instead */
255
 
    Vector<HttpHeaderEntry *> entries;          /* parsed fields in raw format */
256
 
    HttpHeaderMask mask;        /* bit set <=> entry present */
257
 
    http_hdr_owner_type owner;  /* request or reply */
258
 
    int len;                    /* length when packed, not counting terminating '\0' */
259
267
 
260
268
private:
261
269
    HttpHeaderEntry *findLastEntry(http_hdr_type id) const;
262
 
    // Make it non-copyable. Our destructor is a bit nasty...
 
270
    /// Made it non-copyable. Our destructor is a bit nasty...
263
271
    HttpHeader(const HttpHeader &);
264
272
    //assignment is used by the reset method, can't block it..
265
273
    //const HttpHeader operator=(const HttpHeader &);
266
274
};
267
275
 
268
276
 
269
 
extern void httpHeaderRegisterWithCacheManager(CacheManager & manager);
270
277
extern int httpHeaderParseQuotedString (const char *start, String *val);
271
278
SQUIDCEXTERN int httpHeaderHasByNameListMember(const HttpHeader * hdr, const char *name, const char *member, const char separator);
272
279
SQUIDCEXTERN void httpHeaderUpdate(HttpHeader * old, const HttpHeader * fresh, const HttpHeaderMask * denied_mask);