[squid-dev] [PATCH] keep track of the size of uploads done with CONNECT
Aymeric Vincent
aymericvincent at free.fr
Tue Sep 15 19:29:19 UTC 2015
Hi,
thank you for your detailed explanations.
Alex Rousskov <rousskov at measurement-factory.com> writes:
> 1a. Since you are polishing tunnelStart() profile anyway, delete the
> status_ptr parameter as well. AFAICT, that parameter is as unneeded as
> the size_ptr parameter you have already deleted. Use al->http.code
> inside tunnelStart() instead. This will leave you with two parameters:
> ClientHttpRequest and AccessLogEntry pointers.
>
> 1b. Use (1a) logic above to delete the AccessLogEntry::Pointer parameter
> as well. Initialize TunnelStateData::al with http->al.
>
> 2. Convert TunnelStateData::Connection::size_ptr into an "uint64_t
> bytesSent" or a similar data member (not a pointer). It will still be
> updated by TunnelStateData::Connection::dataSent().
>
> 3. In TunnelStateData destructor, update ALE "al" as needed, using
> client.bytesSent and server.bytesSent values. Test that you have guessed
> which one is which correctly -- they are confusing.
so I implemented your proposal, except for (2) and (3) because
TunnelStateData::Connection::size_ptr, I think, should remain for the
time being. I tried to remove it but switchToTunnel() is using it to
point to some (other, it seems) http's out.size field due probably to
the nesting of connections in the ssl bump case. There are other xxx_ptr
fields in TSD which serve this nesting purpose as well IIUC.
This means I had to sprinkle a minimal amount of s/int64_t/uint64_t/
changes to remove the ugly pointer cast in tunnelStart() but they are a
step in the right direction if I'm not mistaken.
> Your patch, even after a few takes, will not solve all the upload size
> logging problems, of course, but I think that encapsulating tunnel
> upload size accounting code in tunnel.cc is the right step.
Fully agreed.
Best regards,
Aymeric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-squid-account-connect-uploads-take-3
Type: application/octet-stream
Size: 4829 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150915/86755dcc/attachment.obj>
More information about the squid-dev
mailing list