Added docu on CGI server and CGI scripts package.

This commit is contained in:
interp 2002-04-14 17:04:26 +00:00
parent af97738352
commit a9033bfc76
3 changed files with 61 additions and 2 deletions

View File

@ -5,4 +5,17 @@
\item[Name of the package:] cgi-script \item[Name of the package:] cgi-script
\end{description} \end{description}
% %
Not implemented yet. \subsection{Procedures}
\begin{defundesc}{cgi-form-query}{}{data-alist}
CGI scripts receive their parameters in various ways, depending on
how they were called (e.g. by ``GET'' method). This procedure
translates the delivered form data into an alist of decoded strings,
using the environment variables set by the server
(\ex{REQUEST\_METHOD}, \ex{QUERY\_STRING} (``GET'' script),
\ex{CONTENT\_LENGTH} (``POST'' script)). So a query string like
\codex{button=on\&\ob{}reply=Oh,\ob{}\%20yes} becomes alist
\codex{(("button" . "on") ("reply" . "Oh, yes"))} This only works for
GET and POST methods.
\end{defundesc}

View File

@ -5,4 +5,49 @@
\item[Name of the package:] cgi-server \item[Name of the package:] cgi-server
\end{description} \end{description}
% %
Not implemented yet. \subsection{Variables}
\defvar{cgi-default-bin-path}{string}
\begin{desc}
This variable contains the path for scripts. Its value is
\codex{/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin}
\end{desc}
\subsection{Procedures}
\begin{defundesc}{cgi-handler}{bin-dir}{path-handler}
Returns a path handler (see \ref{httpd:path-handlers} for details
about path handlers) for cgi-scripts located in
\semvar{bin-dir}. The scripts are called as specified by
CGI/1.1\footnote{see
\ex{http://hoohoo.ncsa.uiuc.edu/cgi/interface.html} for a sort of
specification.}.
\begin{itemize}
\item Various environment variables are set (like
\ex{QUERY\_STRING} or \ex{REMOTE\_HOST}).
\item ISINDEX queries get their arguments as command line arguments.
\item Scripts are handled differently according to their name:
\begin{itemize}
\item If the name of the script starts with `\ex{nph-}', its reply
is read, the RFC~822-fields like ``Content-Type'' and ``Status''
are parsed and the client is sent back a real HTTP reply,
containing the rest of the script's output.
\item If the name of the script doesn't start with `\ex{nph-}',
its output is sent back to the client directly. If its return code
is not zero, an error message is generated.
\end{itemize}
\end{itemize}
\end{defundesc}
\begin{defundesc}{initialise-request-invariant-cgi-env}{}{\noreturn}
Initializes the environment variables that are invariant from
cgi-call to cgi-call in order to save calculation time. Call this
procedure before you start your httpd. You have to do this, if you
use cgi-scripts, that read out the environment variables \ex{PATH},
\ex{SERVER\_SOFTWARE}, \ex{SERVER\_NAME} or \ex{GATEWAY\_INTERFACE}.
\end{defundesc}

View File

@ -181,6 +181,7 @@ one argument, a \ex{httpd\=options}-record:
\end{desc} \end{desc}
\subsubsection*{Path handlers} \subsubsection*{Path handlers}
\label{httpd:path-handlers}
A path handler is a procedure taking two arguments: A path handler is a procedure taking two arguments:
\defun{path-handler}{path req}{value} \defun{path-handler}{path req}{value}