Re: multiple questions regarging squid code

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 17 Mar 2003 08:24:36 +0100

atit_ldce wrote:
>
> why ps_state struct is passed as callback data in call of aclNBCheck (in peer_select.c)

Because peer_select.c need to know the ps_struct for the request to be
able to continue processing the request after the cache_peer_access
checks have completed.

> what acl.c will do with this callback data.(i gone through acl.c but things are not clear).

just send it back to peer_select when the peer access check is
completed.

> what cbdatalock() function will do?

See the programmers guide. It has an extensive section on what cbdata
is, why it is needed, and how it is used.

> what following constant (defined in enums.h enum icp_opcode) will indicate?
>
> "ICP_SEND",
> "ICP_SENDA",
> "ICP_DATABEG",
> "ICP_DATA",
> "ICP_DATAEND",
> "ICP_NOTIFY",
> "ICP_INVALIDATE",
> "ICP_DELETE",
> "ICP_END"

These are extension ICP opcodes and is not used by Squid. I don't know
where to find specification of these ICP codes.

> what is purpose of delay variable in icpUdpSend in icp_v2.c
> if delay is o then squid will Queue the message.why this is done?
> what is purpose of queueing ICP messages?

Network is slower than CPU. If Squid tries to send a lot of ICP messages
at once it will need to wait for the network. Delay measures how long a
packed was waiting in the queue.

> what is significance for INCOMING_ICP_MAX constant?
> (in defines.h it is mentioned that
> max number of ICP messages to receive per call to icpHandleUdp())
> but thing is not clear...
> why we want restriction of this kind

Because we do not want to give ICP processing a too high priority in
relation to processing of HTTP requests in case we are flooded with ICP
messages.

> what is purpose of incoming_sockets_accepted?

Same thing, but for accepting new connections. There is a limit on how
many new connections will be accepted per main loop, to not give
accepting new connections a too high priority in relation to processing
of already accepted connections.

Regards
Henrik
Received on Mon Mar 17 2003 - 00:32:49 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:33 MST