2 * Copyright (C) 1996-2016 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 "base/InstanceId.h"
14 #include "base/Lock.h"
15 #include "comm/forward.h"
17 /** Master transaction details.
19 * Aggregates historical data from individual related protocol-specific
20 * transactions such as an HTTP client transaction and the corresponding
21 * HTTP or FTP server transaction.
23 * Individual transaction information worth sending or logging should be
24 * recorded here, ideally without exposing other master transaction users
25 * to internal details of individual transactions. For example, storing an
26 * HTTP client IP address is a good idea but storing a pointer to some
27 * client-side job which maintains that address is not.
29 * A master transaction is created by a newly accepted client connection,
30 * a new request on the existing client connection, or an internal request
31 * generated by Squid. All client-side protocols, including HTTP, HTCP, ICP,
32 * and SNMP will eventually create master transactions.
34 * A master transaction is auto-destroyed when its last user is gone.
36 class MasterXaction
: public RefCountable
39 typedef RefCount
<MasterXaction
> Pointer
;
42 InstanceId
<MasterXaction
> id
;
44 /// the listening port which originated this transaction
45 AnyP::PortCfgPointer squidPort
;
47 /// the client TCP connection which originated this transaction
48 Comm::ConnectionPointer tcpClient
;
50 // TODO: add state from other Jobs in the transaction
53 #endif /* SQUID_SRC_MASTERXACTION_H */