2 * DEBUG: section 12 Internet Cache Protocol (ICP)
3 * AUTHOR: Duane Wessels
5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
34 \defgroup ServerProtocolICPInternal2 ICPv2 Internals
35 \ingroup ServerProtocolICPAPI
38 #include "squid-old.h"
41 #include "comm/Connection.h"
42 #include "comm/Loops.h"
43 #include "comm/UdpOpenDialer.h"
45 #include "HttpRequest.h"
46 #include "acl/FilledChecklist.h"
48 #include "AccessLogEntry.h"
50 #include "StatCounters.h"
51 #include "SquidTime.h"
53 #include "icmp/net_db.h"
54 #include "ip/Address.h"
59 static void icpIncomingConnectionOpened(const Comm::ConnectionPointer
&conn
, int errNo
);
61 /// \ingroup ServerProtocolICPInternal2
62 static void icpLogIcp(const Ip::Address
&, log_type
, int, const char *, int);
64 /// \ingroup ServerProtocolICPInternal2
65 static void icpHandleIcpV2(int, Ip::Address
&, char *, int);
67 /// \ingroup ServerProtocolICPInternal2
68 static void icpCount(void *, int, size_t, int);
71 \ingroup ServerProtocolICPInternal2
72 * IcpQueueHead is global so comm_incoming() knows whether or not
73 * to call icpUdpSendQueue.
75 static icpUdpData
*IcpQueueHead
= NULL
;
76 /// \ingroup ServerProtocolICPInternal2
77 static icpUdpData
*IcpQueueTail
= NULL
;
79 /// \ingroup ServerProtocolICPInternal2
80 Comm::ConnectionPointer icpIncomingConn
= NULL
;
81 /// \ingroup ServerProtocolICPInternal2
82 Comm::ConnectionPointer icpOutgoingConn
= NULL
;
85 _icp_common_t::_icp_common_t() : opcode(ICP_INVALID
), version(0), length(0), reqnum(0), flags(0), pad(0), shostid(0)
88 _icp_common_t::_icp_common_t(char *buf
, unsigned int len
)
90 if (len
< sizeof(_icp_common_t
)) {
96 memcpy(this, buf
, sizeof(icp_common_t
));
98 * Convert network order sensitive fields
100 length
= ntohs(length
);
101 reqnum
= ntohl(reqnum
);
102 flags
= ntohl(flags
);
107 _icp_common_t::getOpCode() const
109 if (opcode
> (char)ICP_END
)
112 return (icp_opcode
)opcode
;
117 ICPState::ICPState(icp_common_t
&aHeader
, HttpRequest
*aRequest
):
119 request(HTTPMSGLOCK(aRequest
)),
124 ICPState::~ICPState()
127 HTTPMSGUNLOCK(request
);
135 /// \ingroup ServerProtocolICPInternal2
136 class ICP2State
: public ICPState
, public StoreClient
140 ICP2State(icp_common_t
& aHeader
, HttpRequest
*aRequest
):
141 ICPState(aHeader
, aRequest
),rtt(0),src_rtt(0),flags(0) {}
144 void created(StoreEntry
* newEntry
);
151 ICP2State::~ICP2State()
155 ICP2State::created(StoreEntry
*newEntry
)
157 StoreEntry
*entry
= newEntry
->isNull () ? NULL
: newEntry
;
158 debugs(12, 5, "icpHandleIcpV2: OPCODE " << icp_opcode_str
[header
.opcode
]);
159 icp_opcode codeToSend
;
161 if (icpCheckUdpHit(entry
, request
)) {
162 codeToSend
= ICP_HIT
;
165 if (Config
.onoff
.test_reachability
&& rtt
== 0) {
166 if ((rtt
= netdbHostRtt(request
->GetHost())) == 0)
167 netdbPingSite(request
->GetHost());
169 #endif /* USE_ICMP */
171 if (icpGetCommonOpcode() != ICP_ERR
)
172 codeToSend
= icpGetCommonOpcode();
173 else if (Config
.onoff
.test_reachability
&& rtt
== 0)
174 codeToSend
= ICP_MISS_NOFETCH
;
176 codeToSend
= ICP_MISS
;
179 icpCreateAndSend(codeToSend
, flags
, url
, header
.reqnum
, src_rtt
, fd
, from
);
185 /// \ingroup ServerProtocolICPInternal2
187 icpLogIcp(const Ip::Address
&caddr
, log_type logcode
, int len
, const char *url
, int delay
)
191 if (LOG_TAG_NONE
== logcode
)
194 if (LOG_ICP_QUERY
== logcode
)
197 clientdbUpdate(caddr
, logcode
, AnyP::PROTO_ICP
, len
);
199 if (!Config
.onoff
.log_udp
)
202 al
.icp
.opcode
= ICP_QUERY
;
206 al
.cache
.caddr
= caddr
;
208 al
.cache
.replySize
= len
;
210 al
.cache
.code
= logcode
;
212 al
.cache
.msec
= delay
;
214 accessLogLog(&al
, NULL
);
217 /// \ingroup ServerProtocolICPInternal2
219 icpUdpSendQueue(int fd
, void *unused
)
223 while ((q
= IcpQueueHead
) != NULL
) {
224 int delay
= tvSubUsec(q
->queue_time
, current_time
);
225 /* increment delay to prevent looping */
226 const int x
= icpUdpSend(fd
, q
->address
, (icp_common_t
*) q
->msg
, q
->logcode
, ++delay
);
227 IcpQueueHead
= q
->next
;
236 _icp_common_t::createMessage(
244 icp_common_t
*headerp
= NULL
;
245 char *urloffset
= NULL
;
247 buf_len
= sizeof(icp_common_t
) + strlen(url
) + 1;
249 if (opcode
== ICP_QUERY
)
250 buf_len
+= sizeof(uint32_t);
252 buf
= (char *) xcalloc(buf_len
, 1);
254 headerp
= (icp_common_t
*) (void *) buf
;
256 headerp
->opcode
= (char) opcode
;
258 headerp
->version
= ICP_VERSION_CURRENT
;
260 headerp
->length
= (uint16_t) htons(buf_len
);
262 headerp
->reqnum
= htonl(reqnum
);
264 headerp
->flags
= htonl(flags
);
266 headerp
->pad
= htonl(pad
);
268 headerp
->shostid
= 0;
270 urloffset
= buf
+ sizeof(icp_common_t
);
272 if (opcode
== ICP_QUERY
)
273 urloffset
+= sizeof(uint32_t);
275 memcpy(urloffset
, url
, strlen(url
));
277 return (icp_common_t
*)buf
;
282 const Ip::Address
&to
,
290 len
= (int) ntohs(msg
->length
);
291 debugs(12, 5, "icpUdpSend: FD " << fd
<< " sending " <<
292 icp_opcode_str
[msg
->opcode
] << ", " << len
<< " bytes to " << to
);
294 x
= comm_udp_sendto(fd
, to
, msg
, len
);
297 /* successfully written */
298 icpLogIcp(to
, logcode
, len
, (char *) (msg
+ 1), delay
);
299 icpCount(msg
, SENT
, (size_t) len
, delay
);
301 } else if (0 == delay
) {
302 /* send failed, but queue it */
303 queue
= (icpUdpData
*) xcalloc(1, sizeof(icpUdpData
));
306 queue
->len
= (int) ntohs(msg
->length
);
307 queue
->queue_time
= current_time
;
308 queue
->logcode
= logcode
;
310 if (IcpQueueHead
== NULL
) {
311 IcpQueueHead
= queue
;
312 IcpQueueTail
= queue
;
313 } else if (IcpQueueTail
== IcpQueueHead
) {
314 IcpQueueTail
= queue
;
315 IcpQueueHead
->next
= queue
;
317 IcpQueueTail
->next
= queue
;
318 IcpQueueTail
= queue
;
321 Comm::SetSelect(fd
, COMM_SELECT_WRITE
, icpUdpSendQueue
, NULL
, 0);
322 statCounter
.icp
.replies_queued
++;
325 statCounter
.icp
.replies_dropped
++;
332 icpCheckUdpHit(StoreEntry
* e
, HttpRequest
* request
)
337 if (!e
->validToSend())
340 if (Config
.onoff
.icp_hit_stale
)
343 if (refreshCheckICP(e
, request
))
350 * This routine selects an ICP opcode for ICP misses.
352 \retval ICP_ERR no opcode selected here
353 \retval ICP_MISS_NOFETCH store is rebuilding, no fetch is possible yet
358 /* if store is rebuilding, return a UDP_MISS_NOFETCH */
360 if ((StoreController::store_dirs_rebuilding
&& opt_reload_hit_only
) ||
361 hit_only_mode_until
> squid_curtime
) {
362 return ICP_MISS_NOFETCH
;
369 icpLogFromICPCode(icp_opcode opcode
)
371 if (opcode
== ICP_ERR
)
372 return LOG_UDP_INVALID
;
374 if (opcode
== ICP_DENIED
)
375 return LOG_UDP_DENIED
;
377 if (opcode
== ICP_HIT
)
380 if (opcode
== ICP_MISS
)
383 if (opcode
== ICP_MISS_NOFETCH
)
384 return LOG_UDP_MISS_NOFETCH
;
386 fatal("expected ICP opcode\n");
388 return LOG_UDP_INVALID
;
392 icpCreateAndSend(icp_opcode opcode
, int flags
, char const *url
, int reqnum
, int pad
, int fd
, const Ip::Address
&from
)
394 icp_common_t
*reply
= _icp_common_t::createMessage(opcode
, flags
, url
, reqnum
, pad
);
395 icpUdpSend(fd
, from
, reply
, icpLogFromICPCode(opcode
), 0);
399 icpDenyAccess(Ip::Address
&from
, char *url
, int reqnum
, int fd
)
401 debugs(12, 2, "icpDenyAccess: Access Denied for " << from
<< " by " << AclMatchedName
<< ".");
403 if (clientdbCutoffDenied(from
)) {
405 * count this DENIED query in the clientdb, even though
406 * we're not sending an ICP reply...
408 clientdbUpdate(from
, LOG_UDP_DENIED
, AnyP::PROTO_ICP
, 0);
410 icpCreateAndSend(ICP_DENIED
, 0, url
, reqnum
, 0, fd
, from
);
415 icpAccessAllowed(Ip::Address
&from
, HttpRequest
* icp_request
)
417 /* absent an explicit allow, we deny all */
418 if (!Config
.accessList
.icp
)
421 ACLFilledChecklist
checklist(Config
.accessList
.icp
, icp_request
, NULL
);
422 checklist
.src_addr
= from
;
423 checklist
.my_addr
.SetNoAddr();
424 return (checklist
.fastCheck() == ACCESS_ALLOWED
);
428 icpGetUrlToSend(char *url
)
430 if (strpbrk(url
, w_space
))
431 return rfc1738_escape(url
);
437 icpGetRequest(char *url
, int reqnum
, int fd
, Ip::Address
&from
)
439 if (strpbrk(url
, w_space
)) {
440 url
= rfc1738_escape(url
);
441 icpCreateAndSend(ICP_ERR
, 0, rfc1738_escape(url
), reqnum
, 0, fd
, from
);
447 if ((result
= HttpRequest::CreateFromUrl(url
)) == NULL
)
448 icpCreateAndSend(ICP_ERR
, 0, url
, reqnum
, 0, fd
, from
);
455 doV2Query(int fd
, Ip::Address
&from
, char *buf
, icp_common_t header
)
460 /* We have a valid packet */
461 char *url
= buf
+ sizeof(icp_common_t
) + sizeof(uint32_t);
462 HttpRequest
*icp_request
= icpGetRequest(url
, header
.reqnum
, fd
, from
);
467 HTTPMSGLOCK(icp_request
);
469 if (!icpAccessAllowed(from
, icp_request
)) {
470 icpDenyAccess(from
, url
, header
.reqnum
, fd
);
471 HTTPMSGUNLOCK(icp_request
);
475 if (header
.flags
& ICP_FLAG_SRC_RTT
) {
476 rtt
= netdbHostRtt(icp_request
->GetHost());
477 int hops
= netdbHostHops(icp_request
->GetHost());
478 src_rtt
= ((hops
& 0xFFFF) << 16) | (rtt
& 0xFFFF);
481 flags
|= ICP_FLAG_SRC_RTT
;
483 #endif /* USE_ICMP */
485 /* The peer is allowed to use this cache */
486 ICP2State
*state
= new ICP2State (header
, icp_request
);
492 state
->url
= xstrdup (url
);
494 state
->flags
= flags
;
498 state
->src_rtt
= src_rtt
;
500 StoreEntry::getPublic (state
, url
, METHOD_GET
);
502 HTTPMSGUNLOCK(icp_request
);
506 _icp_common_t::handleReply(char *buf
, Ip::Address
&from
)
508 if (neighbors_do_private_keys
&& reqnum
== 0) {
509 debugs(12, 0, "icpHandleIcpV2: Neighbor " << from
<< " returned reqnum = 0");
510 debugs(12, 0, "icpHandleIcpV2: Disabling use of private keys");
511 neighbors_do_private_keys
= 0;
514 char *url
= buf
+ sizeof(icp_common_t
);
515 debugs(12, 3, "icpHandleIcpV2: " << icp_opcode_str
[opcode
] << " from " << from
<< " for '" << url
<< "'");
517 const cache_key
*key
= icpGetCacheKey(url
, (int) reqnum
);
518 /* call neighborsUdpAck even if ping_status != PING_WAITING */
519 neighborsUdpAck(key
, this, from
);
523 icpHandleIcpV2(int fd
, Ip::Address
&from
, char *buf
, int len
)
526 debugs(12, 3, "icpHandleIcpV2: ICP message is too small");
530 icp_common_t
header(buf
, len
);
532 * Length field should match the number of bytes read
535 if (len
!= header
.length
) {
536 debugs(12, 3, "icpHandleIcpV2: ICP message is too small");
540 switch (header
.opcode
) {
543 /* We have a valid packet */
544 doV2Query(fd
, from
, buf
, header
);
555 case ICP_MISS_NOFETCH
:
556 header
.handleReply(buf
, from
);
565 debugs(12, 0, "icpHandleIcpV2: UNKNOWN OPCODE: " << header
.opcode
<< " from " << from
);
573 icpPktDump(icp_common_t
* pkt
)
577 debugs(12, 9, "opcode: " << std::setw(3) << pkt
->opcode
<< " " << icp_opcode_str
[pkt
->opcode
]);
578 debugs(12, 9, "version: "<< std::left
<< std::setw(8) << pkt
->version
);
579 debugs(12, 9, "length: "<< std::left
<< std::setw(8) << ntohs(pkt
->length
));
580 debugs(12, 9, "reqnum: "<< std::left
<< std::setw(8) << ntohl(pkt
->reqnum
));
581 debugs(12, 9, "flags: "<< std::left
<< std::hex
<< std::setw(8) << ntohl(pkt
->flags
));
582 a
= (struct in_addr
)pkt
->shostid
;
583 debugs(12, 9, "shostid: " << a
);
584 debugs(12, 9, "payload: " << (char *) pkt
+ sizeof(icp_common_t
));
590 icpHandleUdp(int sock
, void *data
)
592 int *N
= &incoming_sockets_accepted
;
595 LOCAL_ARRAY(char, buf
, SQUID_UDP_SO_RCVBUF
);
598 int max
= INCOMING_ICP_MAX
;
599 Comm::SetSelect(sock
, COMM_SELECT_READ
, icpHandleUdp
, NULL
, 0);
602 len
= comm_udp_recvfrom(sock
,
604 SQUID_UDP_SO_RCVBUF
- 1,
612 if (ignoreErrno(errno
))
616 /* Some Linux systems seem to set the FD for reading and then
617 * return ECONNREFUSED when sendto() fails and generates an ICMP
618 * port unreachable message. */
619 /* or maybe an EHOSTUNREACH "No route to host" message */
620 if (errno
!= ECONNREFUSED
&& errno
!= EHOSTUNREACH
)
623 debugs(50, 1, "icpHandleUdp: FD " << sock
<< " recvfrom: " << xstrerror());
629 icpCount(buf
, RECV
, (size_t) len
, 0);
631 debugs(12, 4, "icpHandleUdp: FD " << sock
<< ": received " <<
632 (unsigned long int)len
<< " bytes from " << from
);
634 #ifdef ICP_PACKET_DUMP
639 if ((size_t) len
< sizeof(icp_common_t
)) {
640 debugs(12, 4, "icpHandleUdp: Ignoring too-small UDP packet");
644 icp_version
= (int) buf
[1]; /* cheat! */
646 if (icpOutgoingConn
->local
== from
)
647 // ignore ICP packets which loop back (multicast usually)
648 debugs(12, 4, "icpHandleUdp: Ignoring UDP packet sent by myself");
649 else if (icp_version
== ICP_VERSION_2
)
650 icpHandleIcpV2(sock
, from
, buf
, len
);
651 else if (icp_version
== ICP_VERSION_3
)
652 icpHandleIcpV3(sock
, from
, buf
, len
);
654 debugs(12, 1, "WARNING: Unused ICP version " << icp_version
<<
655 " received from " << from
);
660 icpConnectionsOpen(void)
664 if ((port
= Config
.Port
.icp
) <= 0)
667 icpIncomingConn
= new Comm::Connection
;
668 icpIncomingConn
->local
= Config
.Addrs
.udp_incoming
;
669 icpIncomingConn
->local
.SetPort(port
);
671 if (!Ip::EnableIpv6
&& !icpIncomingConn
->local
.SetIPv4()) {
672 debugs(12, DBG_CRITICAL
, "ERROR: IPv6 is disabled. " << icpIncomingConn
->local
<< " is not an IPv4 address.");
673 fatal("ICP port cannot be opened.");
675 /* split-stack for now requires default IPv4-only ICP */
676 if (Ip::EnableIpv6
&IPV6_SPECIAL_SPLITSTACK
&& icpIncomingConn
->local
.IsAnyAddr()) {
677 icpIncomingConn
->local
.SetIPv4();
680 AsyncCall::Pointer call
= asyncCall(12, 2,
681 "icpIncomingConnectionOpened",
682 Comm::UdpOpenDialer(&icpIncomingConnectionOpened
));
684 Ipc::StartListening(SOCK_DGRAM
,
687 Ipc::fdnInIcpSocket
, call
);
689 if ( !Config
.Addrs
.udp_outgoing
.IsNoAddr() ) {
690 icpOutgoingConn
= new Comm::Connection
;
691 icpOutgoingConn
->local
= Config
.Addrs
.udp_outgoing
;
692 icpOutgoingConn
->local
.SetPort(port
);
694 if (!Ip::EnableIpv6
&& !icpOutgoingConn
->local
.SetIPv4()) {
695 debugs(49, DBG_CRITICAL
, "ERROR: IPv6 is disabled. " << icpOutgoingConn
->local
<< " is not an IPv4 address.");
696 fatal("ICP port cannot be opened.");
698 /* split-stack for now requires default IPv4-only ICP */
699 if (Ip::EnableIpv6
&IPV6_SPECIAL_SPLITSTACK
&& icpOutgoingConn
->local
.IsAnyAddr()) {
700 icpOutgoingConn
->local
.SetIPv4();
704 comm_open_listener(SOCK_DGRAM
, IPPROTO_UDP
, icpOutgoingConn
, "Outgoing ICP Port");
707 if (!Comm::IsConnOpen(icpOutgoingConn
))
708 fatal("Cannot open Outgoing ICP Port");
710 debugs(12, DBG_CRITICAL
, "Sending ICP messages from " << icpOutgoingConn
->local
);
712 Comm::SetSelect(icpOutgoingConn
->fd
, COMM_SELECT_READ
, icpHandleUdp
, NULL
, 0);
713 fd_note(icpOutgoingConn
->fd
, "Outgoing ICP socket");
718 icpIncomingConnectionOpened(const Comm::ConnectionPointer
&conn
, int errNo
)
720 if (!Comm::IsConnOpen(conn
))
721 fatal("Cannot open ICP Port");
723 Comm::SetSelect(conn
->fd
, COMM_SELECT_READ
, icpHandleUdp
, NULL
, 0);
725 for (const wordlist
*s
= Config
.mcast_group_list
; s
; s
= s
->next
)
726 ipcache_nbgethostbyname(s
->key
, mcastJoinGroups
, NULL
); // XXX: pass the conn for mcastJoinGroups usage.
728 debugs(12, DBG_IMPORTANT
, "Accepting ICP messages on " << conn
->local
);
730 fd_note(conn
->fd
, "Incoming ICP port");
732 if (Config
.Addrs
.udp_outgoing
.IsNoAddr()) {
733 icpOutgoingConn
= conn
;
734 debugs(12, DBG_IMPORTANT
, "Sending ICP messages from " << icpOutgoingConn
->local
);
739 * icpConnectionShutdown only closes the 'in' socket if it is
740 * different than the 'out' socket.
743 icpConnectionShutdown(void)
745 if (!Comm::IsConnOpen(icpIncomingConn
))
748 debugs(12, DBG_IMPORTANT
, "Stop receiving ICP on " << icpIncomingConn
->local
);
750 /** Release the 'in' socket for lazy closure.
751 * in and out sockets may be sharing one same FD.
752 * This prevents this function from executing repeatedly.
754 icpIncomingConn
= NULL
;
757 * Normally we only write to the outgoing ICP socket, but
758 * we also have a read handler there to catch messages sent
759 * to that specific interface. During shutdown, we must
760 * disable reading on the outgoing socket.
762 assert(Comm::IsConnOpen(icpOutgoingConn
));
764 Comm::SetSelect(icpOutgoingConn
->fd
, COMM_SELECT_READ
, NULL
, NULL
, 0);
768 icpConnectionClose(void)
770 icpConnectionShutdown();
772 if (icpOutgoingConn
!= NULL
) {
773 debugs(12, DBG_IMPORTANT
, "Stop sending ICP from " << icpOutgoingConn
->local
);
774 icpOutgoingConn
= NULL
;
779 icpCount(void *buf
, int which
, size_t len
, int delay
)
781 icp_common_t
*icp
= (icp_common_t
*) buf
;
783 if (len
< sizeof(*icp
))
787 statCounter
.icp
.pkts_sent
++;
788 kb_incr(&statCounter
.icp
.kbytes_sent
, len
);
790 if (ICP_QUERY
== icp
->opcode
) {
791 statCounter
.icp
.queries_sent
++;
792 kb_incr(&statCounter
.icp
.q_kbytes_sent
, len
);
794 statCounter
.icp
.replies_sent
++;
795 kb_incr(&statCounter
.icp
.r_kbytes_sent
, len
);
796 /* this is the sent-reply service time */
797 statCounter
.icp
.replySvcTime
.count(delay
);
800 if (ICP_HIT
== icp
->opcode
)
801 statCounter
.icp
.hits_sent
++;
802 } else if (RECV
== which
) {
803 statCounter
.icp
.pkts_recv
++;
804 kb_incr(&statCounter
.icp
.kbytes_recv
, len
);
806 if (ICP_QUERY
== icp
->opcode
) {
807 statCounter
.icp
.queries_recv
++;
808 kb_incr(&statCounter
.icp
.q_kbytes_recv
, len
);
810 statCounter
.icp
.replies_recv
++;
811 kb_incr(&statCounter
.icp
.r_kbytes_recv
, len
);
812 /* statCounter.icp.querySvcTime set in clientUpdateCounters */
815 if (ICP_HIT
== icp
->opcode
)
816 statCounter
.icp
.hits_recv
++;
820 #define N_QUERIED_KEYS 8192
821 #define N_QUERIED_KEYS_MASK 8191
822 static cache_key queried_keys
[N_QUERIED_KEYS
][SQUID_MD5_DIGEST_LENGTH
];
825 icpSetCacheKey(const cache_key
* key
)
827 static int reqnum
= 0;
832 storeKeyCopy(queried_keys
[reqnum
& N_QUERIED_KEYS_MASK
], key
);
838 icpGetCacheKey(const char *url
, int reqnum
)
840 if (neighbors_do_private_keys
&& reqnum
)
841 return queried_keys
[reqnum
& N_QUERIED_KEYS_MASK
];
843 return storeKeyPublic(url
, METHOD_GET
);