On 10/31/2011 03:03 PM, Andrew Beverley wrote:
> Having thought about this further, I think what I was trying to achieve
> was getting the mark every time a packet was received.
> I have tried putting the relevant code into
> ServerStateData::addVirginReplyBody() which seems to work for different
> protocols as well as being called for each packet received.
>
> Is there any problems with this approach? If not, I will refine and
> submit a patch.
Yes, if you do not care about HTTP response header or FTP control
messages: ServerStateData::addVirginReplyBody() is not called when the
HTTP header or FTP control messages are received. If you want to catch
those cases (it sounds like you do based on your "every packet"
description above), then you need HttpStateData::readReply() and
equivalent read handlers in other protocols.
I do not think there is a single Server method that is always called for
every Squid read. You should probably add it and call it from the
corresponding HTTP and FTP-specific code.
Please keep in mind that Squid does not work on a TCP packet level. It
uses the TCP socket interface and the read(2) may happen when there are
multiple packets in the buffer already.
HTH,
Alex.
Received on Mon Oct 31 2011 - 21:42:56 MDT
This archive was generated by hypermail 2.2.0 : Tue Nov 01 2011 - 12:00:10 MDT