2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_SRC_MASTERXACTION_H
10 #define SQUID_SRC_MASTERXACTION_H
12 #include "anyp/forward.h"
13 #include "anyp/PortCfg.h"
14 #include "base/InstanceId.h"
15 #include "base/Lock.h"
16 #include "base/RefCount.h"
17 #include "comm/forward.h"
18 #include "XactionInitiator.h"
20 /** Master transaction details.
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.
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.
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.
37 * A master transaction is auto-destroyed when its last user is gone.
39 class MasterXaction
: public RefCountable
42 typedef RefCount
<MasterXaction
> Pointer
;
44 explicit MasterXaction(const XactionInitiator anInitiator
) : initiator(anInitiator
) {};
47 InstanceId
<MasterXaction
> id
;
49 /// the listening port which originated this transaction
50 AnyP::PortCfgPointer squidPort
;
52 /// the client TCP connection which originated this transaction
53 Comm::ConnectionPointer tcpClient
;
55 /// the initiator of this transaction
56 XactionInitiator initiator
;
58 // TODO: add state from other Jobs in the transaction
61 #endif /* SQUID_SRC_MASTERXACTION_H */