ADP Output Crossover

Rob Mayoff <mayoff@arsdigita.com>

Test case:

  1. Run nsd using nsd.tcl as the config file:
    /home/aol30/bin/nsd8x -ft nsd.tcl

  2. Load http://localhost:10080/test-1.tcl. You should get this output:

    Server Error


    The server encountered a configuration or operating system error while attempting to satisfy your request.
    test-1.tcl includes test-1.adp, which throws an error.

  3. Load http://localhost:10080/test-2.adp. You should get this output:
    (test-1.adp 1) (test-1.adp 2) (test-2.adp)
    This output is buggy. If you look at test-2.adp, you'll see that the only message it outputs is (test-2.adp). Some output from test-1.adp got left in the ADP output buffer when test-1.adp threw an error, and Ns_AdpRequest sent it along with the test-2.adp output.
This patch fixes Ns_AdpRequest to only send the correct part of the buffer.