]>
Commit | Line | Data |
---|---|---|
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 | 43 | extern int clientBeginRequest(method_t, char const *, CSCB *, CSD *, ClientStreamData, HttpHeader const *, char *, size_t); |
c8be6d7b | 44 | |
90f396d5 | 45 | class MemObject; |
62e76326 | 46 | |
924f73bc | 47 | class ConnStateData; |
48 | ||
62e76326 | 49 | class ClientHttpRequest |
50 | { | |
51 | ||
528b2c61 | 52 | public: |
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 | ||
102 | unsigned int accel: | |
103 | 1; | |
104 | ||
d048c262 | 105 | unsigned int transparent: |
106 | 1; | |
107 | ||
62e76326 | 108 | unsigned int internal: |
109 | 1; | |
110 | ||
111 | unsigned int done_copying: | |
112 | 1; | |
113 | ||
114 | unsigned 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 | 135 | private: |
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 | 144 | SQUIDCEXTERN char *clientConstructTraceEcho(ClientHttpRequest *); |
98242069 | 145 | SQUIDCEXTERN ACLChecklist *clientAclChecklistCreate(const acl_access * acl,ClientHttpRequest * http); |
59a1efb2 | 146 | SQUIDCEXTERN int clientHttpRequestStatus(int fd, ClientHttpRequest const *http); |
8e2745f4 | 147 | SQUIDCEXTERN void clientAccessCheck(ClientHttpRequest *); |
528b2c61 | 148 | |
149 | /* ones that should be elsewhere */ | |
59a1efb2 | 150 | SQUIDCEXTERN void redirectStart(ClientHttpRequest *, RH *, void *); |
528b2c61 | 151 | |
59a1efb2 | 152 | SQUIDCEXTERN 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 */ |