Squid Web Cache master
Loading...
Searching...
No Matches
StrandSearch.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 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/* DEBUG: section 54 Interprocess Communication */
10
11#include "squid.h"
12#include "globals.h"
13#include "ipc/Messages.h"
14#include "ipc/StrandSearch.h"
15#include "ipc/TypedMsgHdr.h"
16
18 requestorId(KidIdentifier),
19 tag(aTag),
20 qid(MyQuestionerId())
21{
22}
23
25 requestorId(-1)
26{
27 hdrMsg.checkType(mtFindStrand);
28 hdrMsg.getPod(requestorId);
29 hdrMsg.getString(tag);
30 qid.unpack(hdrMsg);
31}
32
34{
35 hdrMsg.setType(mtFindStrand);
36 hdrMsg.putPod(requestorId);
37 hdrMsg.putString(tag);
38 qid.pack(hdrMsg);
39}
40
void unpack(const TypedMsgHdr &)
for receiving the ID of the asking process
void pack(TypedMsgHdr &hdrMsg) const
prepare for sendmsg()
int requestorId
sender-provided return address
StrandSearchRequest(const String &aTag)
sender's constructor
String tag
set when looking for a matching StrandCoord::tag
QuestionerId qid
the sender of the request
struct msghdr with a known type, fixed-size I/O and control buffers
Definition TypedMsgHdr.h:35
void putString(const String &s)
store variable-length string
void getPod(Pod &pod) const
load POD
void getString(String &s) const
load variable-length string
void checkType(int aType) const
void putPod(const Pod &pod)
store POD
void setType(int aType)
sets message type; use MessageType enum
int KidIdentifier
QuestionerId MyQuestionerId()
the questioner ID of the current/calling process
@ mtFindStrand
a worker requests a strand from Coordinator
Definition Messages.h:25