]> git.ipfire.org Git - thirdparty/squid.git/blame - src/client_side_request.h
Added #ifdef-ef out code for future work on ICAP RESPMOD POSTCACHE
[thirdparty/squid.git] / src / client_side_request.h
CommitLineData
c8be6d7b 1
2/*
8ae66e43 3 * $Id: client_side_request.h,v 1.21 2005/09/12 22:26:39 wessels Exp $
c8be6d7b 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_CLIENTSIDEREQUEST_H
35#define SQUID_CLIENTSIDEREQUEST_H
36
528b2c61 37#include "HttpHeader.h"
38#include "clientStream.h"
a2ac85d9 39#include "client_side.h"
450e0c10 40#include "AccessLogEntry.h"
528b2c61 41
c8be6d7b 42/* client_side_request.c - client side request related routines (pure logic) */
0655fa4d 43extern int clientBeginRequest(method_t, char const *, CSCB *, CSD *, ClientStreamData, HttpHeader const *, char *, size_t);
c8be6d7b 44
90f396d5 45class MemObject;
62e76326 46
924f73bc 47class ConnStateData;
48
62e76326 49class ClientHttpRequest
50{
51
528b2c61 52public:
53 void *operator new (size_t);
54 void operator delete (void *);
528b2c61 55
56 ClientHttpRequest();
57 ~ClientHttpRequest();
58 /* Not implemented - present to prevent synthetic operations */
59 ClientHttpRequest(ClientHttpRequest const &);
60 ClientHttpRequest& operator=(ClientHttpRequest const &);
62e76326 61
528b2c61 62 String rangeBoundaryStr() const;
63 void freeResources();
64 void updateCounters();
65 void logRequest();
86a2f789 66 _SQUID_INLINE_ MemObject * memObject() const;
528b2c61 67 bool multipartRangeRequest() const;
8e2745f4 68 void processRequest();
69 void httpStart();
0655fa4d 70 bool onlyIfCached()const;
71 bool gotEnough() const;
86a2f789 72 _SQUID_INLINE_ StoreEntry *storeEntry() const;
73 void storeEntry(StoreEntry *);
0976f8db 74 _SQUID_INLINE_ StoreEntry *loggingEntry() const;
75 void loggingEntry(StoreEntry *);
0655fa4d 76
a2ac85d9 77 _SQUID_INLINE_ ConnStateData::Pointer getConn();
78 _SQUID_INLINE_ ConnStateData::Pointer const getConn() const;
79 _SQUID_INLINE_ void setConn(ConnStateData::Pointer);
190154cf 80 HttpRequest *request; /* Parsed URL ... */
528b2c61 81 char *uri;
82 char *log_uri;
62e76326 83
84 struct
85 {
86 off_t offset;
87 size_t size;
88 size_t headers_sz;
89 }
90
91 out;
528b2c61 92 HttpHdrRangeIter range_iter; /* data for iterating thru range specs */
93 size_t req_sz; /* raw request size on input, not current request size */
528b2c61 94 log_type logType;
62e76326 95
528b2c61 96 struct timeval start;
528b2c61 97 AccessLogEntry al;
62e76326 98
99 struct
100 {
101
102unsigned int accel:
103 1;
104
d048c262 105unsigned int transparent:
106 1;
107
62e76326 108unsigned int internal:
109 1;
110
111unsigned int done_copying:
112 1;
113
114unsigned int purging:
115 1;
116 }
117
118 flags;
119
120 struct
121 {
122 http_status status;
123 char *location;
124 }
125
126 redirect;
528b2c61 127 dlink_node active;
128 dlink_list client_stream;
129 int mRangeCLen();
62e76326 130
b51aec66 131 ssize_t maxReplyBodySize() const;
132 void maxReplyBodySize(ssize_t size);
133 bool isReplyBodyTooLarge(ssize_t len) const;
134
528b2c61 135private:
136 CBDATA_CLASS(ClientHttpRequest);
86a2f789 137 ssize_t maxReplyBodySize_;
138 StoreEntry *entry_;
0976f8db 139 StoreEntry *loggingEntry_;
a2ac85d9 140 ConnStateData::Pointer conn_;
528b2c61 141};
142
143/* client http based routines */
59a1efb2 144SQUIDCEXTERN char *clientConstructTraceEcho(ClientHttpRequest *);
98242069 145SQUIDCEXTERN ACLChecklist *clientAclChecklistCreate(const acl_access * acl,ClientHttpRequest * http);
59a1efb2 146SQUIDCEXTERN int clientHttpRequestStatus(int fd, ClientHttpRequest const *http);
8e2745f4 147SQUIDCEXTERN void clientAccessCheck(ClientHttpRequest *);
528b2c61 148
149/* ones that should be elsewhere */
59a1efb2 150SQUIDCEXTERN void redirectStart(ClientHttpRequest *, RH *, void *);
528b2c61 151
59a1efb2 152SQUIDCEXTERN void sslStart(ClientHttpRequest *, size_t *, int *);
528b2c61 153
86a2f789 154#ifdef _USE_INLINE_
4b9bb50a 155#include "Store.h"
86a2f789 156#include "client_side_request.cci"
157#endif
158
c8be6d7b 159#endif /* SQUID_CLIENTSIDEREQUEST_H */