sön 2008-01-06 klockan 12:27 +0200 skrev Tsantilas Christos:
> Hi Henrik,
>  It is not a cbdata problem.

Are you sure?

cbdata exists to help invalidate callbacks when they are no longer
meaningful. A callback being made to something no longer meaningful is a
clear sign of a missing cbdata barrier..

> An example is in the HttpStateData::sendComplete method which is going
> to execute an  commSetTimeout(fd ...)

The FD related state should no longer exist if the FD has been closed.
That's what cbdata deals with.

> Also I had a similar problem in tunnel.cc with  the tunnelClientClosed
> and tunnelServerClosed comm_close handlers, where the comm_close handler
> of server closes the client socket and opposite.

Yes, that state object is a bit difficult as it manages both, and need
to be extra careful.

> With this patch squid now starts closing the fd , it mark it as
> "closing" but actually schedules the real fd  closing to a future, after
> the comm_close handlers will be really executed.

And why is this needed? The sendComplete callback should be invalidated
if the HTTP connection state is no longer there.

Adding this reshedule adds a noticeable overhead an delay, plus makes
tracing of the code flow more difficult.

Regards
Henrik

Reply via email to