]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/CommCalls.cc
5 /* CommCommonCbParams */
7 CommCommonCbParams::CommCommonCbParams(void *aData
):
8 data(cbdataReference(aData
)), fd(-1), xerrno(0), flag(COMM_OK
)
12 CommCommonCbParams::CommCommonCbParams(const CommCommonCbParams
&p
):
13 data(cbdataReference(p
.data
)), fd(p
.fd
), xerrno(p
.xerrno
), flag(p
.flag
)
17 CommCommonCbParams::~CommCommonCbParams()
19 cbdataReferenceDone(data
);
23 CommCommonCbParams::print(std::ostream
&os
) const
27 os
<< ", errno=" << xerrno
;
29 os
<< ", flag=" << flag
;
31 os
<< ", data=" << data
;
35 /* CommAcceptCbParams */
37 CommAcceptCbParams::CommAcceptCbParams(void *aData
): CommCommonCbParams(aData
),
43 CommAcceptCbParams::print(std::ostream
&os
) const
45 CommCommonCbParams::print(os
);
47 os
<< ", newFD " << nfd
;
51 /* CommConnectCbParams */
53 CommConnectCbParams::CommConnectCbParams(void *aData
):
54 CommCommonCbParams(aData
)
61 CommIoCbParams::CommIoCbParams(void *aData
): CommCommonCbParams(aData
),
67 CommIoCbParams::syncWithComm()
69 // change parameters if the call was scheduled before comm_close but
70 // is being fired after comm_close
71 if (fd
>= 0 && fd_table
[fd
].closing() && flag
!= COMM_ERR_CLOSING
) {
72 debugs(5, 3, HERE
<< "converting late call to COMM_ERR_CLOSING: FD " << fd
);
73 flag
= COMM_ERR_CLOSING
;
80 CommIoCbParams::print(std::ostream
&os
) const
82 CommCommonCbParams::print(os
);
84 os
<< ", size=" << size
;
85 os
<< ", buf=" << (void*)buf
;
90 /* CommCloseCbParams */
92 CommCloseCbParams::CommCloseCbParams(void *aData
):
93 CommCommonCbParams(aData
)
97 /* CommTimeoutCbParams */
99 CommTimeoutCbParams::CommTimeoutCbParams(void *aData
):
100 CommCommonCbParams(aData
)
105 /* CommAcceptCbPtrFun */
107 CommAcceptCbPtrFun::CommAcceptCbPtrFun(IOACB
*aHandler
,
108 const CommAcceptCbParams
&aParams
):
109 CommDialerParamsT
<CommAcceptCbParams
>(aParams
),
115 CommAcceptCbPtrFun::dial()
117 handler(params
.fd
, params
.nfd
, ¶ms
.details
, params
.flag
, params
.xerrno
, params
.data
);
121 CommAcceptCbPtrFun::print(std::ostream
&os
) const
129 /* CommConnectCbPtrFun */
131 CommConnectCbPtrFun::CommConnectCbPtrFun(CNCB
*aHandler
,
132 const CommConnectCbParams
&aParams
):
133 CommDialerParamsT
<CommConnectCbParams
>(aParams
),
139 CommConnectCbPtrFun::dial()
141 handler(params
.fd
, params
.flag
, params
.xerrno
, params
.data
);
145 CommConnectCbPtrFun::print(std::ostream
&os
) const
155 CommIoCbPtrFun::CommIoCbPtrFun(IOCB
*aHandler
, const CommIoCbParams
&aParams
):
156 CommDialerParamsT
<CommIoCbParams
>(aParams
),
162 CommIoCbPtrFun::dial()
164 handler(params
.fd
, params
.buf
, params
.size
, params
.flag
, params
.xerrno
, params
.data
);
168 CommIoCbPtrFun::print(std::ostream
&os
) const
176 /* CommCloseCbPtrFun */
178 CommCloseCbPtrFun::CommCloseCbPtrFun(PF
*aHandler
,
179 const CommCloseCbParams
&aParams
):
180 CommDialerParamsT
<CommCloseCbParams
>(aParams
),
186 CommCloseCbPtrFun::dial()
188 handler(params
.fd
, params
.data
);
192 CommCloseCbPtrFun::print(std::ostream
&os
) const
199 /* CommTimeoutCbPtrFun */
201 CommTimeoutCbPtrFun::CommTimeoutCbPtrFun(PF
*aHandler
,
202 const CommTimeoutCbParams
&aParams
):
203 CommDialerParamsT
<CommTimeoutCbParams
>(aParams
),
209 CommTimeoutCbPtrFun::dial()
211 handler(params
.fd
, params
.data
);
215 CommTimeoutCbPtrFun::print(std::ostream
&os
) const