]> git.ipfire.org Git - thirdparty/squid.git/blame - src/MasterXaction.h
Maintenance: Update astyle version to 3.1 (#841)
[thirdparty/squid.git] / src / MasterXaction.h
CommitLineData
bbc27441 1/*
f70aedc4 2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
bbc27441
AJ
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
94bfd31f
AJ
9#ifndef SQUID_SRC_MASTERXACTION_H
10#define SQUID_SRC_MASTERXACTION_H
11
12#include "anyp/forward.h"
5ceaee75 13#include "anyp/PortCfg.h"
94bfd31f
AJ
14#include "base/InstanceId.h"
15#include "base/Lock.h"
5ceaee75 16#include "base/RefCount.h"
94bfd31f 17#include "comm/forward.h"
5ceaee75 18#include "XactionInitiator.h"
94bfd31f
AJ
19
20/** Master transaction details.
21 *
22 * Aggregates historical data from individual related protocol-specific
23 * transactions such as an HTTP client transaction and the corresponding
24 * HTTP or FTP server transaction.
25 *
26 * Individual transaction information worth sending or logging should be
27 * recorded here, ideally without exposing other master transaction users
28 * to internal details of individual transactions. For example, storing an
29 * HTTP client IP address is a good idea but storing a pointer to some
30 * client-side job which maintains that address is not.
31 *
32 * A master transaction is created by a newly accepted client connection,
33 * a new request on the existing client connection, or an internal request
34 * generated by Squid. All client-side protocols, including HTTP, HTCP, ICP,
35 * and SNMP will eventually create master transactions.
36 *
37 * A master transaction is auto-destroyed when its last user is gone.
38 */
39class MasterXaction : public RefCountable
40{
41public:
42 typedef RefCount<MasterXaction> Pointer;
43
5ceaee75
CT
44 explicit MasterXaction(const XactionInitiator anInitiator) : initiator(anInitiator) {};
45
94bfd31f 46 /// transaction ID.
7cfd3a41 47 InstanceId<MasterXaction, uint64_t> id;
94bfd31f
AJ
48
49 /// the listening port which originated this transaction
50 AnyP::PortCfgPointer squidPort;
51
52 /// the client TCP connection which originated this transaction
53 Comm::ConnectionPointer tcpClient;
54
5ceaee75
CT
55 /// the initiator of this transaction
56 XactionInitiator initiator;
57
090f1d3c
CT
58 /// whether we are currently creating a CONNECT header (to be sent to peer)
59 bool generatingConnect = false;
60
94bfd31f
AJ
61 // TODO: add state from other Jobs in the transaction
62};
63
64#endif /* SQUID_SRC_MASTERXACTION_H */
f53969cc 65