Dossy wrote:

I've been wondering about this and decided to review some of the code
that is called in my AOLserver.

There seems to be a wrong manner of coding that sometimes there is
somefile.adp which does <% ns_returnredirect /someotherfile.adp %>. It
does not always call ns_adp_(abort|break) - this is a big simplification.

Anyway, what I guess is that first the redirect is sent, and then the
adp handler tries to returns the rest of the ADP file. The problem could
be (I'm only guessing :) that this could happen:

thread1:
1/ accept() returns a new socket (ID=3)
2/ ns_returnredirect sends the response and closes socket 3
3/ parser returns the response (to socket 3) and closes the connection

thread2:
1/ accept() returns a new socket (ID=3)
2/ something returns the response and closes the connection

If thread1's 3/ would execute between thread2's 1/ and 2/, this could
cause the socket being closed with 0 length result and similar problems.

I've read 3.4.2 code and it seems that Ns_ConnClose sets NS_CONN_CLOSED
flag, however no other function even uses the flag.

I want to work around the problem by adding a sanity check on the
NS_CONN_CLOSED flag, so that I can see if this is the problem.

Are there any side effects I can encounter by checking this flag?

ps. The situation is far more complicated. I do ns_register_url and then
do ns_return 200 text/html [ns_adp_parse -file /somefile.adp] and then I
cannot simply do ns_adp_break/ns_adp_abort - this throws an error.

--
WK


-- AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to