]> git.ipfire.org Git - thirdparty/squid.git/blob - src/HttpRequest.h
Summary: Final MSVC fixups.
[thirdparty/squid.git] / src / HttpRequest.h
1
2 /*
3 * $Id: HttpRequest.h,v 1.7 2003/08/10 11:00:40 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 "HttpHeader.h"
39 #include "client_side.h"
40
41 /* Http Request */
42 extern HttpRequest *requestCreate(method_t, protocol_t, const char *urlpath);
43 extern void requestDestroy(HttpRequest *);
44 extern HttpRequest *requestLink(HttpRequest *);
45 extern void requestUnlink(HttpRequest *);
46 extern int httpRequestParseHeader(HttpRequest * req, const char *parse_start);
47 extern void httpRequestSwapOut(const HttpRequest * req, StoreEntry * e);
48 extern void httpRequestPack(const HttpRequest * req, Packer * p);
49 extern int httpRequestPrefixLen(const HttpRequest * req);
50 extern int httpRequestHdrAllowed(const HttpHeaderEntry * e, String * strConnection);
51 extern int httpRequestHdrAllowedByName(http_hdr_type id);
52
53 class HttpHdrRange;
54
55 class HttpRequest
56 {
57
58 public:
59 void *operator new(size_t);
60 void operator delete(void *);
61 HttpRequest();
62 virtual ~HttpRequest() {}
63
64 bool multipartRangeRequest() const;
65
66 method_t method;
67 protocol_t protocol;
68 char login[MAX_LOGIN_SZ];
69 char host[SQUIDHOSTNAMELEN + 1];
70 auth_user_request_t *auth_user_request;
71 u_short port;
72 String urlpath;
73 char *canonical;
74 int link_count; /* free when zero */
75 request_flags flags;
76 HttpHdrCc *cache_control;
77 HttpHdrRange *range;
78 http_version_t http_ver;
79 time_t ims;
80 int imslen;
81 int max_forwards;
82 /* these in_addr's could probably be sockaddr_in's */
83
84 struct in_addr client_addr;
85
86 struct in_addr my_addr;
87 unsigned short my_port;
88 unsigned short client_port;
89 HttpHeader header;
90 ConnStateData::Pointer body_connection; /* used by clientReadBody() */
91 int content_length;
92 HierarchyLogEntry hier;
93 err_type errType;
94 char *peer_login; /* Configured peer login:password */
95 time_t lastmod; /* Used on refreshes */
96 const char *vary_headers; /* Used when varying entities are detected. Changes how the store key is calculated */
97 char *peer_domain; /* Configured peer forceddomain */
98 String tag; /* Internal tag for this request */
99 String extacl_user; /* User name returned by extacl lookup */
100 String extacl_passwd; /* Password returned by extacl lookup */
101 String extacl_log; /* String to be used for access.log purposes */
102
103 private:
104 static MemPool *Pool;
105 };
106
107 #endif /* SQUID_HTTPREQUEST_H */