[squid-dev] [PATCH] keep track of the size of uploads done with CONNECT
Aymeric Vincent
aymericvincent at free.fr
Mon Sep 14 20:22:36 UTC 2015
Thank you for your fast reply.
Alex Rousskov <rousskov at measurement-factory.com> writes:
> You are adding a new ClientHttpRequest in_size field dedicated to
> client-sent "payload" sizes in tunnels, but Squid seems to be using
> AccessLogEntry's http.clientRequestSz.payloadData for similar purposes
> in non-tunnel areas of the code. Would it be possible to teach tunnel.cc
> code to update http.clientRequestSz.payloadData (directly or indirectly)
> instead of adding a new field?
Here is a quick patch doing what you suggest. However:
- it doesn't match what happens in client_side.cc where log data gets
filled in after the fact (see most notably req_sz field) but this may
need fixing too after all
- it currently requires a cast because tunnelStart() expects (signed)
int64_t's whereas payloadData is (unsigned) uint64_t, and switching to
uint64_t everywhere requires an audit because out.size gets compared
to some other signed quantity (expectedLength) in at least one place.
This pulls strings in many places where int64_t's are used for size
quantities.
The cast is harmless because this integer gets only added to, but it's
still a cast
If you are not satisfied with any of the two patches, please tell me
which direction you prefer and I can work on a more extensive patch
tomorrow. IMHO the advantage of the first patch is its blending with the
current code, while other nicer solutions will require changing a few
types here and there, which could be done as a second, wider, cleaning
step.
Best regards,
Aymeric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-squid-account-connect-uploads-take-2
Type: application/octet-stream
Size: 2784 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150914/0e49b15a/attachment.obj>
More information about the squid-dev
mailing list