1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Netcgi_jserv.html">
<link rel="next" href="Netcgi_jserv_app.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Netcgi_env" rel="Chapter" href="Netcgi_env.html">
<link title="Netcgi_types" rel="Chapter" href="Netcgi_types.html">
<link title="Netcgi" rel="Chapter" href="Netcgi.html">
<link title="Netcgi_jserv" rel="Chapter" href="Netcgi_jserv.html">
<link title="Netcgi_jserv_ajp12" rel="Chapter" href="Netcgi_jserv_ajp12.html">
<link title="Netcgi_jserv_app" rel="Chapter" href="Netcgi_jserv_app.html">
<link title="Netcgi_fcgi_10" rel="Chapter" href="Netcgi_fcgi_10.html">
<link title="Netcgi_fcgi" rel="Chapter" href="Netcgi_fcgi.html">
<link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html"><title>Ocamlnet 2 Reference Manual (netcgi1 add-on) : Netcgi_jserv_ajp12</title>
</head>
<body>
<div class="navbar"><a href="Netcgi_jserv.html">Previous</a>
<a href="index.html">Up</a>
<a href="Netcgi_jserv_app.html">Next</a>
</div>
<center><h1>Module <a href="type_Netcgi_jserv_ajp12.html">Netcgi_jserv_ajp12</a></h1></center>
<br>
<pre><span class="keyword">module</span> Netcgi_jserv_ajp12: <code class="code">sig</code> <a href="Netcgi_jserv_ajp12.html">..</a> <code class="code">end</code></pre>Implementation of the AJP/1.2 protocol<br>
<hr width="100%">
<br>
This module implements the core of the AJP/1.2 protocol. This protocol is supported
by both the old mod_jserv and by the newer mod_jk (Jakarta/Tomcat).
Note however, that mod_jserv passes more variables, and that it is fully CGI
compatible. In contrast to this, mod_jk omits some variables (e.g.
PATH_INFO, and SCRIPT_NAME). These variables must be fixed by special
rules, see below. Furthermore, mod_jk has a different format
of the property file, but it is not (yet) accepted by this library.
mod_jk does not support authentication for AJP/1.2. So try to get
mod_jserv if possible.<br>
<pre><span class="keyword">val</span> <a name="VALserve_connection"></a>serve_connection : <code class="type">?config:<a href="Netcgi_env.html#TYPEcgi_config">Netcgi_env.cgi_config</a> -><br> ?https:bool -><br> ?jk_servletSubString:string -><br> (string option -> string option -> <a href="Netcgi_env.cgi_environment.html">Netcgi_env.cgi_environment</a> -> unit) -><br> <a href="Netcgi_jserv.html#TYPEauth">Netcgi_jserv.auth</a> option -><br> Netchannels.in_obj_channel -> Netchannels.out_obj_channel -> unit</code></pre><div class="info">
Serves the connection designated by the <code class="code">in_obj_channel</code> and the
<code class="code">out_obj_channel</code>. The function ensures that both channels are closed
before it returns to the caller (and before it raises an exception).
<p>
If an authentication record <code class="code">auth</code> is passed, the connection is authenticated
first. If this fails, the channels will be closed immediately, and the
function will return normally.
<p>
The request is read from the <code class="code">in_obj_channel</code>, and a <code class="code">cgi_environment</code>
is created from it. The request handler is called with this
environment and two extra string option arguments. The first is the
zone, and the second is the servlet identifier. The request handler
may look like a small CGI program:
<p>
<pre><code class="code"> (fun zone servlet env ->
let cgi = new std_activation ~env () in
cgi # set_header();
cgi # output # output_string "Hello world!";
cgi # output # commit_work();
)
</code></pre>
<p>
If the request arriving at the <code class="code">in_obj_channel</code> is a signal, the function
will close both channels, and will raise either <code class="code">Signal_restart</code> or
<code class="code">Signal_shutdown</code>.
<p>
<br>
</div>
<div class="param_info"><code class="code">config</code> : This is the configuration of the <code class="code">cgi_environment</code>. It defaults
to <a href="Netcgi_env.html#VALdefault_config"><code class="code">Netcgi_env.default_config</code></a></div>
<div class="param_info"><code class="code">https</code> : Because AJP/1.2 does not pass the <code class="code">HTTPS</code> variable, it is necessary
to set this argument to <code class="code">true</code> if the server is secure.</div>
<div class="param_info"><code class="code">jk_servletSubString</code> : The fields <code class="code">servlet</code>, <code class="code">path_info</code>, and <code class="code">script_name</code>
are always empty if mod_jk is used. There is a fixup routine that
is controlled by this optional argument, and that will be invoked if
servlet is empty. The fixup is
that the string <code class="code">jk_servletSubString</code> is searched in the request URI,
and if it is found, the following modifications will be applied:
The <code class="code">servlet</code> is set to the path component following <code class="code">jk_servletSubString</code>.
The <code class="code">path_info</code> is set to the rest of the URI. The <code class="code">script_name</code> is set
to the beginning of the URI until the servlet name (inclusive).
Other fields are not modified. If the string <code class="code">jk_servletSubString</code> is
not found, or if it is the empty string, the <code class="code">servlet</code> name and the
<code class="code">script_name</code> will be set to the request URI, and the <code class="code">path_info</code> will be set
to the empty string.</div>
</body></html>
|