*** doc/Makefile.orig Tue Jul 19 04:18:42 2005 --- doc/Makefile Tue Jul 19 04:31:12 2005 *************** *** 29,36 **** # $Header: /cvsroot/aolserver/aolserver/doc/Makefile,v 1.1 2005/07/18 23:33:47 jgdavidson Exp $ # ! AOLSERVER ?= /usr/local/aolserver ! include $(AOLSERVER)/include/Makefile.global MAN3 := $(wildcard *.3) MANN := $(wildcard *.n) --- 29,35 ---- # $Header: /cvsroot/aolserver/aolserver/doc/Makefile,v 1.1 2005/07/18 23:33:47 jgdavidson Exp $ # ! include ../include/Makefile.global MAN3 := $(wildcard *.3) MANN := $(wildcard *.n) *************** *** 53,63 **** --- 52,64 ---- done install-man3: + $(MKDIR) $(MAN3_DIR) for i in $(MAN3); do \ sh $(MAN_INST) $$i $(MAN3_DIR)/; \ done install-mann: + $(MKDIR) $(MANN_DIR) for i in $(MANN); do \ sh $(MAN_INST) $$i $(MANN_DIR)/; \ done *** include/ns.h.orig Tue Jul 19 03:51:42 2005 --- include/ns.h Tue Jul 19 03:52:50 2005 *************** *** 611,616 **** --- 611,617 ---- NS_EXTERN int Ns_ConnWrite(Ns_Conn *conn, void *buf, int towrite); NS_EXTERN int Ns_ConnFlush(Ns_Conn *conn, char *buf, int len, int stream); NS_EXTERN int Ns_ConnContentFd(Ns_Conn *conn); + NS_EXTERN int Ns_ConnContentOnDisk(Ns_Conn *conn); NS_EXTERN int Ns_ConnReadLine(Ns_Conn *conn, Ns_DString *dsPtr, int *nreadPtr); NS_EXTERN int Ns_WriteConn(Ns_Conn *conn, char *buf, int len); NS_EXTERN int Ns_WriteCharConn(Ns_Conn *conn, char *buf, int len); *** nsd/conn.c.orig Tue Jul 19 03:47:30 2005 --- nsd/conn.c Tue Jul 19 04:04:37 2005 *************** *** 189,194 **** --- 189,223 ---- /* *---------------------------------------------------------------------- * + * Ns_ConnContentOnDisk -- + * + * Return 1 if the content has been copied to a temp file, either + * because it was greater than maxinput, or because Ns_ConnContentFd + * has been called. Returns 0, otherwise. This is useful in the case + * the application wants to be as efficient as possible, and not cause + * excess file creation or mmap()ing. + * + * Results: + * 0 if content only in RAM, 1 if in /tmp file. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + int + Ns_ConnContentOnDisk(Ns_Conn *conn) + { + Conn *connPtr = (Conn *) conn; + + return connPtr->tfd > -1; + } + + + /* + *---------------------------------------------------------------------- + * * Ns_ConnContentFd -- * * Return open fd with request content. The fd is owned by the *** doc/Ns_ConnContent.3.orig Tue Jul 19 04:37:25 2005 --- doc/Ns_ConnContent.3 Tue Jul 19 04:45:55 2005 *************** *** 37,43 **** .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME ! Ns_ConnContent, Ns_ConnContentLength, Ns_ConnContentFd \- access request content .SH SYNOPSIS .nf \fB#include "ns.h"\fR --- 37,43 ---- .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME ! Ns_ConnContent, Ns_ConnContentLength, Ns_ConnContentFd, Ns_ConnContentOnDisk \- access request content .SH SYNOPSIS .nf \fB#include "ns.h"\fR *************** *** 50,55 **** --- 50,58 ---- .sp int \fBNs_ConnContentFd\fR(\fINs_Conn *conn\fR) + .sp + int + \fBNs_ConnContentOnDisk\fR(\fINs_Conn *conn\fR) .SH ARGUMENTS .AS Ns_Conn *conn in .AP Ns_Conn *conn in *************** *** 71,76 **** --- 74,84 ---- \fBNs_ConnContentLength\fR returns the length of the memory buffer and/or the size of the open temp file. Any trailing \\r\\n sent beyond the content from most browsers on a POST is not included. + .PP + \fBNs_ConnContentOnDisk\fR returns 1 if the content is currently on + disk, such that a call to Ns_ConnContentFd will not cause a new file + to be created. When it returns 0, a call to Ns_ConnContent will not require + a mmap() call. .SH "CONTENT PRE-READ" .PP While receiving the request before connection processing, the server *************** *** 79,85 **** config settings. Requests with content beyond the \fImaxcontent\fR virtual server setting are rejected, requests with content between \fImaxinput\fR and \fImaxcontent\fR are spooled to a temp file, and ! small requests (the majority of simply POST's) are copied to memory. There is no need for a request processing extension to consider possible delays in reading content from the client as all content is available before connection processing begins. The rationale --- 87,93 ---- config settings. Requests with content beyond the \fImaxcontent\fR virtual server setting are rejected, requests with content between \fImaxinput\fR and \fImaxcontent\fR are spooled to a temp file, and ! small requests (the majority of simple POST's) are copied to memory. There is no need for a request processing extension to consider possible delays in reading content from the client as all content is available before connection processing begins. The rationale