]> git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/stub_MemObject.cc
Merged from parent (trunk r11446, v3.2.0.7+).
[thirdparty/squid.git] / src / tests / stub_MemObject.cc
1 /*
2 * $Id$
3 *
4 * DEBUG: section 84 Helper process maintenance
5 * AUTHOR: Robert Collins
6 *
7 * SQUID Web Proxy Cache http://www.squid-cache.org/
8 * ----------------------------------------------------------
9 *
10 * Squid is the result of efforts by numerous individuals from
11 * the Internet community; see the CONTRIBUTORS file for full
12 * details. Many organizations have provided support for Squid's
13 * development; see the SPONSORS file for full details. Squid is
14 * Copyrighted (C) 2001 by the Regents of the University of
15 * California; see the COPYRIGHT file for full details. Squid
16 * incorporates software developed and/or copyrighted by other
17 * sources; see the CREDITS file for full details.
18 *
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
32 *
33 */
34
35 #include "squid.h"
36 #include "MemObject.h"
37 #include "HttpReply.h"
38 #if USE_DELAY_POOLS
39 #include "DelayPools.h"
40 #endif
41
42 RemovalPolicy * mem_policy = NULL;
43
44 int64_t
45 MemObject::endOffset() const
46 {
47 return data_hdr.endOffset();
48 }
49
50 void
51 MemObject::trimSwappable()
52 {
53 fatal ("Not implemented");
54 }
55
56 void
57 MemObject::trimUnSwappable()
58 {
59 fatal ("Not implemented");
60 }
61
62 int64_t
63 MemObject::policyLowestOffsetToKeep(bool swap) const
64 {
65 fatal ("Not implemented");
66 return -1;
67 }
68
69 MemObject::MemObject (char const *, char const *)
70 {}
71
72 HttpReply const *
73 MemObject::getReply() const
74 {
75 return NULL;
76 }
77
78 void
79 MemObject::reset()
80 {
81 fatal ("Not implemented");
82 }
83
84 void
85 MemObject::delayRead(DeferredRead const &aRead)
86 {
87 fatal ("Not implemented");
88 }
89
90 bool
91 MemObject::readAheadPolicyCanRead() const
92 {
93 fatal ("Not implemented");
94 return false;
95 }
96
97 void
98 MemObject::setNoDelay(bool const newValue)
99 {
100 fatal ("Not implemented");
101 }
102
103 MemObject::~MemObject()
104 {
105 fatal ("Not implemented");
106 }
107
108 int
109 MemObject::mostBytesWanted(int max) const
110 {
111 fatal ("Not implemented");
112 return -1;
113 }
114
115 #if USE_DELAY_POOLS
116 DelayId
117 MemObject::mostBytesAllowed() const
118 {
119 DelayId result;
120 fatal ("Not implemented");
121 return result;
122 }
123 #endif
124
125 void
126 MemObject::unlinkRequest()
127 {
128 fatal ("Not implemented");
129 }
130
131 void
132 MemObject::write(StoreIOBuffer writeBuffer, STMCB *callback, void *callbackData)
133 {
134 PROF_start(MemObject_write);
135 debugs(19, 6, "memWrite: offset " << writeBuffer.offset << " len " << writeBuffer.length);
136
137 /* the offset is into the content, not the headers */
138 writeBuffer.offset += (_reply ? _reply->hdr_sz : 0);
139
140 /* We don't separate out mime headers yet, so ensure that the first
141 * write is at offset 0 - where they start
142 */
143 assert (data_hdr.endOffset() || writeBuffer.offset == 0);
144
145 assert (data_hdr.write (writeBuffer));
146 callback (callbackData, writeBuffer);
147 PROF_stop(MemObject_write);
148 }
149
150 void
151 MemObject::replaceHttpReply(HttpReply *newrep)
152 {
153 fatal ("Not implemented");
154 }
155
156 int64_t
157 MemObject::lowestMemReaderOffset() const
158 {
159 fatal ("Not implemented");
160 return 0;
161 }
162
163 void
164 MemObject::kickReads()
165 {
166 fatal ("Not implemented");
167 }
168
169 int64_t
170 MemObject::objectBytesOnDisk() const
171 {
172 fatal ("MemObject.cc required.");
173 return 0;
174 }
175
176 bool
177 MemObject::isContiguous() const
178 {
179 fatal ("MemObject.cc required.");
180 return false;
181 }