Andrew,

Hmmm, well without knowing how you tested this, I can't help much. I
created a few test adp pages. I tested them before my changes to
identify the problems.

Here is an example set of pages:
include.adp:
<% 
ns_adp_puts "before include"
ns_adp_include test-ns-return.adp
ns_adp_puts "after include"
ns_log Notice "finished include.adp"
%>
test-ns-return.adp:
<%
ns_return 200 text/plain hi
ns_adp_abort
ns_log Notice "test-ns-return.adp after ns_adp_abort"
%>

The error.log should contain neither of the Notice logs.
The access.log should have a 200 response of content length 2.

Even this produces an access.log entry:

<%
ns_adp_puts hi
ns_adp_abort
%>

A zero length 200 response:

127.0.0.1 - - [06/Apr/2009:13:54:52 -0700] "GET /just-abort.adp
HTTP/1.1" 200 0 "" ""

Did you patch the other two files? (Note that my queue.c file is not
identical to yours, so the patch needs to be applied by hand I think.)

queue.c handles changes to allow logging during error conditions

adprequest.c changes allows distinguishing between actual errors and adp
signaling and translates Tcl return codes into AOLserver request return
codes. Changes also ensure that the adp buffer is cleaned up in all
cases.

adpeval.c changes just ensure that the tcl error code is set to
correspond to the ADP exception code. The code probably needs a comment
because actual errors in ADP processing is signaled when the Tcl return
code is TCL_OK and the adp exception code is ADP_OK. Why? Because on a
tcl error, the ADP code doesn't get to change adp.exception to something
else. 

The bugs in the current code were due to the awkward but necessary
maintenance of these two return codes. The ADP code has gone through a
lot of significant changes, so it is easy to see how these details
didn't make it through correctly. But the simplicity of fixing them
indicates that the code is in pretty good shape. 

Anyway, that is the bugs. The code in queue.c is not bug related, but
allows the client to receive a 500 response on error and to allow
logging during error conditions. 

Here is a link to my patch to my code:

http://www.junom.com/gitweb/gitweb.perl?p=aolserver.git;a=commit;h=ca26f1a

tom jackson




On Mon, 2009-04-06 at 11:13 -0500, Andrew Steets wrote:
> I got a chance to test this out this morning.  I don't understand what
> it is supposed to fix.  I still don't get access log entries when
> ns_adp_abort is called.
> 
> On Sun, Apr 5, 2009 at 12:52 PM, Tom Jackson <[email protected]> wrote:
> > The attached patch fixes ns_adp_break, it differs from the previous
> > patch by one line in  adpeval.c
> >
> > tom jackson
> >
> > On Sat, 2009-04-04 at 16:25 -0500, Andrew Steets wrote:
> >> Hi Tom,
> >>
> >> Attachments seem to work ok on this list.
> >
> >
> >
> > --
> > 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.
> >
> 
> 
> --
> 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.
> 


--
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