]> git.ipfire.org Git - thirdparty/squid.git/blame - src/Server.cc
An ICAP server is allowed to list multiple methods in an options
[thirdparty/squid.git] / src / Server.cc
CommitLineData
cd304fc2 1/*
0c25e715 2 * $Id: Server.cc,v 1.2 2006/01/25 19:26:14 wessels Exp $
cd304fc2 3 *
4 * DEBUG:
5 * AUTHOR: Duane Wessels
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 "Server.h"
37#include "Store.h"
38#include "HttpRequest.h"
39#include "HttpReply.h"
40#if ICAP_CLIENT
41#include "ICAP/ICAPClientRespmodPrecache.h"
42#endif
43
44ServerStateData::ServerStateData(FwdState *theFwdState)
45{
46 fwd = theFwdState;
47 entry = fwd->entry;
48 storeLockObject(entry);
49 request = requestLink(fwd->request);
50}
51
52ServerStateData::~ServerStateData()
53{
54 storeUnlockObject(entry);
55
56 if (request)
57 request->unlock();
58
59 if (reply)
60 reply->unlock();
61
62 fwd = NULL; // refcounted
63
64#if ICAP_CLIENT
65
66 if (icap) {
67 delete icap;
68 cbdataReferenceDone(icap);
69 }
70
71#endif
72}
73
0c25e715 74#if ICAP_CLIENT
cd304fc2 75/*
76 * Initiate an ICAP transaction. Return 0 if all is well, or -1 upon error.
77 * Caller will handle error condition by generating a Squid error message
78 * or take other action.
79 */
80int
81ServerStateData::doIcap(ICAPServiceRep::Pointer service)
82{
83 debug(11,5)("ServerStateData::doIcap() called\n");
84 assert(NULL == icap);
85 icap = new ICAPClientRespmodPrecache(service);
86 (void) cbdataReference(icap);
87 return 0;
88}
0c25e715 89
90#endif