On Sat, 2004-11-06 at 10:06, Henrik Nordstrom wrote:
> On Fri, 5 Nov 2004, Andrew Bartlett wrote:
> 
> > So, on EOF on the input, we should look at the outstanding requests (say
> > off at the DC, awaiting a response) and wait for them to complete before
> > shutting down the helper?
> 
> Correct. The EOF on input currently just says there won't be any 
> additional requests send by Squid, but any yet unanswered requests already 
> received by the helper still need to be answered.
> 
> Thinking about it we could just as well define EOF to mean "quit now", and 
> make Squid delay the EOF signal until it has seen responses to all pending 
> requests. Both approaches have their pros and cons, but the delayed EOF 
> should make life considerably easier in the helper implementations which 
> is a real good thing. For Squid it is trivial.

This would make my job a lot easier, and I suspect most implementations
would have a much better chance of getting it right.

> Opinions?
> 
> If not I'll redefine the protocol to have EOF to the helper mean "shut 
> down immediately" to simplify the helper implementations and provide 
> quicker shutdown causing pending helper requests to be aborted on 
> shutdown.
> 
> Or in other words, if a helper sees EOF it should exit unconditionally.

exit(0) is easy to implement :-)

> In most helpers reading one request at a time using fgets then this is 
> hidden by the libc, but advanced (or in some cases stupid) helpers reading 
> their requests by other methods need to be careful to do it correctly or 
> they may risk corrupting the request stream.

Samba's ntlm_auth just uses fgets(), because I based it on the original
winbind helper from squid.  So my life is easy :-)

Andrew Bartlett

-- 
Andrew Bartlett                                 [EMAIL PROTECTED]
Authentication Developer, Samba Team            http://samba.org
Student Network Administrator, Hawker College   [EMAIL PROTECTED]

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to