]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/MyPortName.cc
f47b57be7a5213c58d850cc8ca932afb5a80706a
[thirdparty/squid.git] / src / acl / MyPortName.cc
1 /*
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #include "squid.h"
10 #include "acl/FilledChecklist.h"
11 #include "acl/MyPortName.h"
12 #include "acl/StringData.h"
13 #include "anyp/PortCfg.h"
14 #include "client_side.h"
15 #include "http/Stream.h"
16 #include "HttpRequest.h"
17
18 int
19 ACLMyPortNameStrategy::match(ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
20 {
21 if (checklist->conn() != nullptr && checklist->conn()->port != nullptr)
22 return data->match(checklist->conn()->port->name);
23 if (checklist->request != nullptr)
24 return data->match(checklist->request->myportname.termedBuf());
25 return 0;
26 }
27