rem: * Set default ADP response buffer size.
add: * Set default ADP flags and buffer size.
context: Ns_AdpRequestEx(Ns_Conn *conn, char *file, Ns_Time *ttlPtr){    Conn	     *connPtr = (Conn *) conn;    Tcl_Interp       *interp;    Tcl_DString	      rds, tds;    NsInterp         *itPtr;    int               result;    char             *type, *start;    Ns_Set           *query;    NsServer	     *servPtr;    Tcl_Obj	     *objv[2];        /*     * Verify the file exists.     */    if (access(file, R_OK) != 0) {	return Ns_ConnReturnNotFound(conn);    }    /*     * Get the current connection's interp.     */    interp = Ns_GetConnInterp(conn);    itPtr = NsGetInterp(interp);    servPtr = itPtr->servPtr;    /*     * Set the response type and output buffers.     */    Tcl_DStringInit(&rds);    Tcl_DStringInit(&tds);    itPtr->adp.responsePtr = &rds;    itPtr->adp.outputPtr = itPtr->adp.responsePtr;    /*     * Determine the output type.  This will set both the input     * and output encodings by default.     */    type = Ns_GetMimeType(file);    if (type == NULL || (strcmp(type, "*/*") == 0)) {        type = NSD_TEXTHTML;    }    Ns_ConnSetType(conn, type);    /*     * Set the old conn variable for backwards compatibility.     */    Tcl_SetVar2(interp, "conn", NULL, connPtr->idstr, TCL_GLOBAL_ONLY);    Tcl_ResetResult(interp);    /*     * Enable TclPro debugging if requested.     */    if ((servPtr->adp.flags & ADP_DEBUG) &&	STREQ(conn->request->method, "GET") &&	(query = Ns_ConnGetQuery(conn)) != NULL) {	itPtr->adp.debugFile = Ns_SetIGet(query, "debug");    }    /*     * Set default ADP response buffer size.     */    itPtr->adp.flags = 0;    itPtr->adp.bufsize = itPtr->servPtr->adp.bufsize;    /*     * Queue the Expires header if enabled.     */    if (servPtr->adp.flags & ADP_EXPIRE) {	Ns_ConnCondSetHeaders(conn, "Expires", "now");    }    /*     * Include the ADP with the special start page and null args.     */    start = servPtr->adp.startpage ? servPtr->adp.startpage : file;    objv[0] = Tcl_NewStringObj(start, -1);    objv[1] = Tcl_NewStringObj(file, -1);    Tcl_IncrRefCount(objv[0]);    Tcl_IncrRefCount(objv[1]);    if (NsAdpInclude(itPtr, start, 2, objv, ttlPtr) != TCL_OK &&        itPtr->adp.exception == ADP_OK) {	Ns_TclLogError(interp);    }    Tcl_DecrRefCount(objv[0]);    Tcl_DecrRefCount(objv[1]);    /*     * Flush the output if the connection isn't already closed.     */    result = NsAdpFlush(itPtr, 0);    if (result != TCL_OK) {	Ns_TclLogError(interp);    }    /*     * Cleanup the per-thead ADP context.     */    itPtr->adp.flags = 0;    itPtr->adp.outputPtr = NULL;    itPtr->adp.responsePtr = NULL;    itPtr->adp.exception = ADP_OK;    itPtr->adp.debugLevel = 0;    itPtr->adp.debugInit = 0;    itPtr->adp.debugFile = NULL;    Tcl_DStringFree(&rds);    Tcl_DStringFree(&tds);    if (result != TCL_OK) {	return NS_ERROR;    }    return NS_OK;}