]> git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/stub_comm.cc
Merge form trunk
[thirdparty/squid.git] / src / tests / stub_comm.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 "comm.h"
37 #include "CommRead.h"
38 #include "fde.h"
39
40 DeferredReadManager::~DeferredReadManager()
41 {
42 /* no networked tests yet */
43 }
44
45 DeferredRead::DeferredRead (DeferrableRead *, void *, CommRead const &)
46 {
47 fatal ("Not implemented");
48 }
49
50 void
51 DeferredReadManager::delayRead(DeferredRead const &aRead)
52 {
53 fatal ("Not implemented");
54 }
55
56 void
57 DeferredReadManager::kickReads(int const count)
58 {
59 fatal ("Not implemented");
60 }
61
62 void
63 comm_read(const Comm::ConnectionPointer &conn, char *buf, int size, IOCB *handler, void *handler_data)
64 {
65 fatal ("Not implemented");
66 }
67
68 void
69 comm_read(const Comm::ConnectionPointer &conn, char*, int, AsyncCall::Pointer &callback)
70 {
71 fatal ("Not implemented");
72 }
73
74 /* should be in stub_CommRead */
75 #include "CommRead.h"
76 CommRead::CommRead (int fd, char *buf, int len, AsyncCall::Pointer &callback)
77 {
78 fatal ("Not implemented");
79 }
80
81 CommRead::CommRead ()
82 {
83 fatal ("Not implemented");
84 }
85
86 void
87 commSetCloseOnExec(int fd)
88 {
89 /* for tests... ignore */
90 }
91
92 void
93 commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
94 time_t timeout)
95 {
96 /* all test code runs synchronously at the moment */
97 }
98
99 void
100 comm_quick_poll_required()
101 {
102 /* for tests ... ignore */
103 }
104
105 int
106 ignoreErrno(int ierrno)
107 {
108 fatal ("Not implemented");
109 return -1;
110 }
111
112 int
113 commSetTimeout(int fd, int timeout, PF * handler, void *data)
114 {
115 fatal ("Not implemented");
116 return -1;
117 }
118
119 int
120 commSetNonBlocking(int fd)
121 {
122 fatal ("Not implemented");
123 return COMM_ERROR;
124 }
125
126 int
127 commUnsetNonBlocking(int fd)
128 {
129 fatal ("Not implemented");
130 return -1;
131 }
132
133 /* bah, cheating on stub count */
134
135 pid_t
136 ipcCreate(int type, const char *prog, const char *const args[], const char *name, Ip::Address &local_addr, int *rfd, int *wfd, void **hIpc)
137 {
138 fatal ("Not implemented");
139 return -1;
140 }
141
142 void
143 comm_init(void)
144 {
145 fd_table =(fde *) xcalloc(Squid_MaxFD, sizeof(fde));
146
147 /* Keep a few file descriptors free so that we don't run out of FD's
148 * after accepting a client but before it opens a socket or a file.
149 * Since Squid_MaxFD can be as high as several thousand, don't waste them */
150 RESERVED_FD = min(100, Squid_MaxFD / 4);
151 }
152
153 /* MinGW needs also a stub of _comm_close() */
154 void
155 _comm_close(int fd, char const *file, int line)
156 {
157 fatal ("Not implemented");
158 }
159
160 int
161 commSetTimeout(int fd, int timeout, AsyncCall::Pointer& callback)
162 {
163 fatal ("Not implemented");
164 return -1;
165 }
166
167 int
168 comm_open_uds(int sock_type, int proto, struct sockaddr_un* addr, int flags)
169 {
170 fatal ("Not implemented");
171 return -1;
172 }
173
174 void
175 comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE * free_func)
176 {
177 fatal ("Not implemented");
178 }
179
180 ConnectionDetail::ConnectionDetail() : me(), peer()
181 {
182 fatal ("Not implemented");
183 }