On 12/17/2014 05:34 PM, Damon Courtney wrote:
> I’m guessing the reason we don’t get an error is because of the
> [no_body] command in there, so the error isn’t getting output. I

yes

TCL_CMD_HEADER( Rivet_NoBody )
{
    rivet_interp_globals *globals =
        Tcl_GetAssocData(interp, "rivet", NULL);

    CHECK_REQUEST_REC(globals->r,"::rivet::no_body");
    if (globals->req->content_sent == 1) {
        Tcl_AddErrorInfo(interp, "Content already sent");
        return TCL_ERROR;
    }

    globals->req->content_sent = 1;
    return TCL_OK;
}

if globals->req->content_sent == 1 then outputproc won't send any data
down the connection through ap_write

    TclWeb_PrintHeaders(private->req);
    if (private->req->content_sent == 0)
    {
        ap_rwrite(buf, toWrite, private->r);
        ap_rflush(private->r);
    }

I was wrong about the flush method of Rivet channel: flush methods are
declared but...for future use, there is no support


> would suggest adding a [headers sent] command that simply returns
> whether the headers have gone out already, and then we use that in
> ::rivet::redirect to return an error.
> 
> The [headers] command has the correct behavior that errors out when
> the headers have already been sent, but we’ve now prevented the error
> from displaying to the user.
> 

OK

> Also, looking at the code, I think we have a discrepancy in the
> [headers] command. The docs imply that most of the arguments to the
> command are optional, but the code says otherwise. For example, the
> docs say:
> 
> headers set ?headername? ?value?
> 
> The ?’s imply that both headername and value are optional arguments.
> I read that to mean that [headers set] by itself will probably return
> a dict of headers (it doesn’t), and [headers set Some-Header] will
> return the current value of the Some-Header header (it doesn’t).
> 
> Changing the docs is the quickest course of action. HOWEVER, it is a
> very Tcl’ish thing to do to have the kind of introspection that would
> be provided by making the headers command arguments actually be
> optional with the behavior I’ve described above.

I will put it in the TODO list

> 
> Anyone know what stupid-ass process I have to go through to get
> committer access with Apache? I haven’t been a committer in a long,
> long time, but I’ve been working pretty steadily in Rivet for a few
> years now, and there are nits I would love to fix. I hate that
> Massimo is the only guy who’s ever in the code. I should get my hands
> dirty. :)
> 
you're very welcome! In case my intervention is requested let me know of
anything I have to do as project chair in order to restore your account

 -- Massimo





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to