~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to src/DelayId.cc

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2009-09-24 14:51:06 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (20.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090924145106-38jgrzmj0d73pha5
Tags: 3.1.0.13-1
* Upload to experimental

* New upstream release
  - Fixes Follow-X-Forwarded-For support (Closes: #523943)
  - Adds IPv6 support (Closes: #432351)

* debian/rules
  - Removed obsolete configuration options
  - Enable db and radius basic authentication modules

* debian/patches/01-cf.data.debian
  - Adapted to new upstream version

* debian/patches/02-makefile-defaults
  - Adapted to new upstream version

* debian/{squid.postinst,squid.rc,README.Debian,watch}
  - Updated references to squid 3.1

* debian/squid3.install
  - Install CSS file for error pages
  - Install manual pages for new authentication modules

* debian/squid3-common.install
  - Install documented version of configuration file in /usr/share/doc/squid3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
/*
3
 
 * $Id: DelayId.cc,v 1.23.2.1 2008/02/10 10:43:09 serassio Exp $
 
3
 * $Id$
4
4
 *
5
5
 * DEBUG: section 77    Delay Pools
6
6
 * AUTHOR: Robert Collins <robertc@squid-cache.org>
23
23
 *  it under the terms of the GNU General Public License as published by
24
24
 *  the Free Software Foundation; either version 2 of the License, or
25
25
 *  (at your option) any later version.
26
 
 *  
 
26
 *
27
27
 *  This program is distributed in the hope that it will be useful,
28
28
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
29
29
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
30
 *  GNU General Public License for more details.
31
 
 *  
 
31
 *
32
32
 *  You should have received a copy of the GNU General Public License
33
33
 *  along with this program; if not, write to the Free Software
34
34
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
47
47
#include "squid.h"
48
48
#include "DelayId.h"
49
49
#include "client_side_request.h"
50
 
#include "ACLChecklist.h"
 
50
#include "acl/FilledChecklist.h"
51
51
#include "DelayPools.h"
52
52
#include "DelayPool.h"
53
53
#include "HttpRequest.h"
81
81
DelayId::operator == (DelayId const &rhs) const
82
82
{
83
83
    /* Doesn't compare composites properly....
84
 
     * only use to test against default ID's 
 
84
     * only use to test against default ID's
85
85
     */
86
86
    return pool_ == rhs.pool_ && compositeId == rhs.compositeId;
87
87
}
100
100
    assert(http);
101
101
    r = http->request;
102
102
 
103
 
    if (r->client_addr.s_addr == INADDR_BROADCAST) {
104
 
        debugs(77, 2, "delayClient: WARNING: Called with 'allones' address, ignoring");
 
103
    if (r->client_addr.IsNoAddr()) {
 
104
        debugs(77, 2, "delayClient: WARNING: Called with 'NO_ADDR' address, ignoring");
105
105
        return DelayId();
106
106
    }
107
107
 
108
108
    for (pool = 0; pool < DelayPools::pools(); pool++) {
109
 
        ACLChecklist ch;
110
 
        ch.src_addr = r->client_addr;
 
109
 
 
110
        /* pools require explicit 'allow' to assign a client into them */
 
111
        if (!DelayPools::delay_data[pool].access) {
 
112
            debugs(77, DBG_IMPORTANT, "delay_pool " << pool <<
 
113
                   " has no delay_access configured. This means that no clients will ever use it.");
 
114
            continue;
 
115
        }
 
116
 
 
117
        ACLFilledChecklist ch(DelayPools::delay_data[pool].access, r, NULL);
 
118
#if FOLLOW_X_FORWARDED_FOR
 
119
        if (Config.onoff.delay_pool_uses_indirect_client)
 
120
            ch.src_addr = r->indirect_client_addr;
 
121
        else
 
122
#endif /* FOLLOW_X_FORWARDED_FOR */
 
123
            ch.src_addr = r->client_addr;
111
124
        ch.my_addr = r->my_addr;
112
 
        ch.my_port = r->my_port;
113
125
 
114
126
        if (http->getConn() != NULL)
115
127
            ch.conn(http->getConn());
116
128
 
117
 
        ch.request = HTTPMSGLOCK(r);
118
 
 
119
 
        ch.accessList = cbdataReference(DelayPools::delay_data[pool].access);
120
 
 
121
 
        /* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */
122
 
 
123
 
        if (DelayPools::delay_data[pool].theComposite().getRaw() &&
124
 
                ch.fastCheck()) {
 
129
        if (DelayPools::delay_data[pool].theComposite().getRaw() && ch.fastCheck()) {
 
130
 
125
131
            DelayId result (pool + 1);
126
132
            CompositePoolNode::CompositeSelectionDetails details;
127
133
            details.src_addr = ch.src_addr;