Channel output proc" ?>

A small example of the junction where Tcl and Apache meet.

static int
outputproc(ClientData instancedata, char *buf,
           int toWrite, int *errorCodePtr)
{
    rivet_server_conf *rsc = (rivet_server_conf *)instancedata;
    rivet_interp_globals *globals =
	Tcl_GetAssocData(rsc->server_interp, "rivet", NULL);

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