]> git.ipfire.org Git - thirdparty/squid.git/blob - src/HttpRequest.h
Summary: ConnStateData tweaks to address race on close.
[thirdparty/squid.git] / src / HttpRequest.h
1
2 /*
3 * $Id: HttpRequest.h,v 1.2 2003/07/11 01:40:35 robertc Exp $
4 *
5 *
6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
8 *
9 * Squid is the result of efforts by numerous individuals from
10 * the Internet community; see the CONTRIBUTORS file for full
11 * details. Many organizations have provided support for Squid's
12 * development; see the SPONSORS file for full details. Squid is
13 * Copyrighted (C) 2001 by the Regents of the University of
14 * California; see the COPYRIGHT file for full details. Squid
15 * incorporates software developed and/or copyrighted by other
16 * sources; see the CREDITS file for full details.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
31 *
32 */
33
34 #ifndef SQUID_HTTPREQUEST_H
35 #define SQUID_HTTPREQUEST_H
36
37 #include "typedefs.h"
38 #include "client_side.h"
39
40 class request_t
41 {
42
43 public:
44 bool multipartRangeRequest() const;
45
46 method_t method;
47 protocol_t protocol;
48 char login[MAX_LOGIN_SZ];
49 char host[SQUIDHOSTNAMELEN + 1];
50 auth_user_request_t *auth_user_request;
51 u_short port;
52 String urlpath;
53 char *canonical;
54 int link_count; /* free when zero */
55 request_flags flags;
56 HttpHdrCc *cache_control;
57 HttpHdrRange *range;
58 http_version_t http_ver;
59 time_t ims;
60 int imslen;
61 int max_forwards;
62 /* these in_addr's could probably be sockaddr_in's */
63
64 struct in_addr client_addr;
65
66 struct in_addr my_addr;
67 unsigned short my_port;
68 unsigned short client_port;
69 HttpHeader header;
70 ConnStateData::Pointer body_connection; /* used by clientReadBody() */
71 int content_length;
72 HierarchyLogEntry hier;
73 err_type errType;
74 char *peer_login; /* Configured peer login:password */
75 time_t lastmod; /* Used on refreshes */
76 const char *vary_headers; /* Used when varying entities are detected. Changes how the store key is calculated */
77 char *peer_domain; /* Configured peer forceddomain */
78 String tag; /* Internal tag for this request */
79 String extacl_user; /* User name returned by extacl lookup */
80 String extacl_passwd; /* Password returned by extacl lookup */
81 String extacl_log; /* String to be used for access.log purposes */
82 };
83
84 /* Http Request */
85 extern request_t *requestCreate(method_t, protocol_t, const char *urlpath);
86 extern void requestDestroy(request_t *);
87 extern request_t *requestLink(request_t *);
88 extern void requestUnlink(request_t *);
89 extern int httpRequestParseHeader(request_t * req, const char *parse_start);
90 extern void httpRequestSwapOut(const request_t * req, StoreEntry * e);
91 extern void httpRequestPack(const request_t * req, Packer * p);
92 extern int httpRequestPrefixLen(const request_t * req);
93 extern int httpRequestHdrAllowed(const HttpHeaderEntry * e, String * strConnection);
94 extern int httpRequestHdrAllowedByName(http_hdr_type id);
95
96
97 #endif /* SQUID_HTTPREQUEST_H */