]> git.ipfire.org Git - thirdparty/squid.git/blob - src/client_side_request.h
Summary: Ran astyle over src subtree.
[thirdparty/squid.git] / src / client_side_request.h
1
2 /*
3 * $Id: client_side_request.h,v 1.7 2003/02/21 22:50:07 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_CLIENTSIDEREQUEST_H
35 #define SQUID_CLIENTSIDEREQUEST_H
36
37 #include "HttpHeader.h"
38 #include "clientStream.h"
39
40 /* client_side_request.c - client side request related routines (pure logic) */
41 extern int clientBeginRequest(method_t, char const *, CSCB *, CSD *, void *, HttpHeader const *, char *, size_t);
42
43 class MemObject;
44
45 typedef class ClientHttpRequest clientHttpRequest;
46
47 class ClientHttpRequest
48 {
49
50 public:
51 void *operator new (size_t);
52 void operator delete (void *);
53 void deleteSelf() const;
54
55 ClientHttpRequest();
56 ~ClientHttpRequest();
57 /* Not implemented - present to prevent synthetic operations */
58 ClientHttpRequest(ClientHttpRequest const &);
59 ClientHttpRequest& operator=(ClientHttpRequest const &);
60
61 String rangeBoundaryStr() const;
62 void freeResources();
63 void updateCounters();
64 void logRequest();
65 MemObject * memObject() const;
66 bool multipartRangeRequest() const;
67 void processRequest();
68 void httpStart();
69 ConnStateData *conn;
70 request_t *request; /* Parsed URL ... */
71 char *uri;
72 char *log_uri;
73
74 struct
75 {
76 off_t offset;
77 size_t size;
78 size_t headers_sz;
79 }
80
81 out;
82 HttpHdrRangeIter range_iter; /* data for iterating thru range specs */
83 size_t req_sz; /* raw request size on input, not current request size */
84 StoreEntry *entry;
85 StoreEntry *old_entry;
86 log_type logType;
87
88 struct timeval start;
89 http_version_t http_ver;
90 AccessLogEntry al;
91
92 struct
93 {
94
95 unsigned int accel:
96 1;
97
98 unsigned int internal:
99 1;
100
101 unsigned int done_copying:
102 1;
103
104 unsigned int purging:
105 1;
106 }
107
108 flags;
109
110 struct
111 {
112 http_status status;
113 char *location;
114 }
115
116 redirect;
117 dlink_node active;
118 dlink_list client_stream;
119 int mRangeCLen();
120
121 private:
122 CBDATA_CLASS(ClientHttpRequest);
123 };
124
125 /* client http based routines */
126 SQUIDCEXTERN char *clientConstructTraceEcho(clientHttpRequest *);
127 SQUIDCEXTERN ACLChecklist *clientAclChecklistCreate(const acl_access * acl, const clientHttpRequest * http);
128 SQUIDCEXTERN void *clientReplyNewContext(clientHttpRequest *);
129 SQUIDCEXTERN int clientHttpRequestStatus(int fd, clientHttpRequest const *http);
130 SQUIDCEXTERN void clientAccessCheck(ClientHttpRequest *);
131
132 /* ones that should be elsewhere */
133 SQUIDCEXTERN void redirectStart(clientHttpRequest *, RH *, void *);
134
135 SQUIDCEXTERN void sslStart(clientHttpRequest *, size_t *, int *);
136
137 #endif /* SQUID_CLIENTSIDEREQUEST_H */