~ubuntu-branches/ubuntu/trusty/ocamlnet/trusty

« back to all changes in this revision

Viewing changes to doc/html-main/netcgi1/Netcgi_env.html

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-09-02 14:12:33 UTC
  • mfrom: (18.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110902141233-zbj0ygxb92u6gy4z
Tags: 3.4-1
* New upstream release
  - add a new NetcgiRequire directive to ease dependency management
    (Closes: #637147)
  - remove patches that were applied upstream:
    + Added-missing-shebang-lines-in-example-shell-scripts
    + Try-also-ocamlc-for-POSIX-threads

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html>
3
 
<head>
4
 
<link rel="stylesheet" href="style.css" type="text/css">
5
 
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
6
 
<link rel="Start" href="index.html">
7
 
<link rel="next" href="Netcgi_types.html">
8
 
<link rel="Up" href="index.html">
9
 
<link title="Index of types" rel=Appendix href="index_types.html">
10
 
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
11
 
<link title="Index of values" rel=Appendix href="index_values.html">
12
 
<link title="Index of class methods" rel=Appendix href="index_methods.html">
13
 
<link title="Index of classes" rel=Appendix href="index_classes.html">
14
 
<link title="Index of class types" rel=Appendix href="index_class_types.html">
15
 
<link title="Index of modules" rel=Appendix href="index_modules.html">
16
 
<link title="Netcgi_env" rel="Chapter" href="Netcgi_env.html">
17
 
<link title="Netcgi_types" rel="Chapter" href="Netcgi_types.html">
18
 
<link title="Netcgi" rel="Chapter" href="Netcgi.html">
19
 
<link title="Netcgi_jserv" rel="Chapter" href="Netcgi_jserv.html">
20
 
<link title="Netcgi_jserv_ajp12" rel="Chapter" href="Netcgi_jserv_ajp12.html">
21
 
<link title="Netcgi_jserv_app" rel="Chapter" href="Netcgi_jserv_app.html">
22
 
<link title="Netcgi_fcgi_10" rel="Chapter" href="Netcgi_fcgi_10.html">
23
 
<link title="Netcgi_fcgi" rel="Chapter" href="Netcgi_fcgi.html">
24
 
<link title="Netcgi1_compat" rel="Chapter" href="Netcgi1_compat.html"><title>Ocamlnet 2 Reference Manual (netcgi1 add-on) : Netcgi_env</title>
25
 
</head>
26
 
<body>
27
 
<div class="navbar">&nbsp;<a href="index.html">Up</a>
28
 
&nbsp;<a href="Netcgi_types.html">Next</a>
29
 
</div>
30
 
<center><h1>Module <a href="type_Netcgi_env.html">Netcgi_env</a></h1></center>
31
 
<br>
32
 
<pre><span class="keyword">module</span> Netcgi_env: <code class="code">sig</code> <a href="Netcgi_env.html">..</a> <code class="code">end</code></pre>Access to the environment for CGI and related protocols<br>
33
 
<hr width="100%">
34
 
<pre><span class="keyword">type</span> <a name="TYPEinput_mode"></a><code class="type"></code>input_mode = <code class="type">[ `Standard ]</code> </pre>
35
 
<div class="info">
36
 
Determines how to read the request:<ul>
37
 
<li><code class="code">`Standard</code>: Only the request body is read from the input
38
 
    channel (CGI standard)</li>
39
 
<li>Not yet implemented: <code class="code">`Direct</code>: Both header and body of the
40
 
   request are read from the input channel</li>
41
 
</ul>
42
 
<br>
43
 
</div>
44
 
 
45
 
<pre><span class="keyword">type</span> <a name="TYPEinput_state"></a><code class="type"></code>input_state = <code class="type">[ `Received_body<br>       | `Received_header<br>       | `Receiving_body<br>       | `Receiving_header<br>       | `Start ]</code> </pre>
46
 
<div class="info">
47
 
The input processing state:<ul>
48
 
<li><code class="code">`Start</code>: Input data have not yet been received</li>
49
 
<li><code class="code">`Receiving_header</code>: The request header is currently being 
50
 
   received</li>
51
 
<li><code class="code">`Received_header</code>: The request header has been completely
52
 
   received, and nothing of the request body has yet been
53
 
   received</li>
54
 
<li><code class="code">`Receiving_body</code>: The request body is currently being 
55
 
   received</li>
56
 
<li><code class="code">`Received_body</code>: The request body has been completely
57
 
   received</li>
58
 
</ul>
59
 
 
60
 
 Transition diagram:
61
 
 <pre><code class="code"> 
62
 
 `Start -&gt; 
63
 
 `Receiving_header -&gt; 
64
 
 `Received_header -&gt;
65
 
 `Receiving_body -&gt; 
66
 
 `Received_body </code></pre><br>
67
 
</div>
68
 
 
69
 
<pre><span class="keyword">type</span> <a name="TYPEoutput_mode"></a><code class="type"></code>output_mode = <code class="type">[ `Standard ]</code> </pre>
70
 
<div class="info">
71
 
Determines how to deliver the response:<ul>
72
 
<li><code class="code">`Standard</code>: The format of the response header has CGI format,
73
 
   followed by the response body</li>
74
 
<li>Not yet implemented: <code class="code">`Direct</code>: The format of the response
75
 
   header has HTTP format, followed by the response body. This
76
 
   is also known as "non-parsed header" format.</li>
77
 
</ul>
78
 
<br>
79
 
</div>
80
 
 
81
 
<pre><span class="keyword">type</span> <a name="TYPEoutput_state"></a><code class="type"></code>output_state = <code class="type">[ `End<br>       | `Sending_body<br>       | `Sending_header<br>       | `Sending_part_body<br>       | `Sending_part_header<br>       | `Sent_body<br>       | `Sent_header<br>       | `Sent_part_body<br>       | `Sent_part_header<br>       | `Start ]</code> </pre>
82
 
<div class="info">
83
 
The output processing state:<ul>
84
 
<li><code class="code">`Start</code>: Output has not yet been sent</li>
85
 
<li><code class="code">`Sending_header</code>: The response header is currently being sent</li>
86
 
<li><code class="code">`Sent_header</code>: The response header has been completely sent,
87
 
   and nothing of the body has yet been sent</li>
88
 
<li><code class="code">`Sending_body</code>: The response body is currently being sent</li>
89
 
<li><code class="code">`Sent_body</code>: The response body has been sent up to a
90
 
   check point</li>
91
 
<li><code class="code">`End</code>: The response has been completely sent</li>
92
 
</ul>
93
 
 
94
 
 Transition diagram:
95
 
 <pre><code class="code">              `Start -&gt;
96
 
              `Sending_header -&gt;
97
 
              `Sent_header -&gt;
98
 
          +-&gt; `Sending_body 
99
 
          |      |
100
 
          |      V
101
 
          +-- `Sent_body 
102
 
                 |
103
 
                 V
104
 
              `End </code></pre>
105
 
<p>
106
 
 
107
 
 The state <code class="code">`Sent_body</code> is reached when the output data are 
108
 
 committed. It is possible to continue with another transaction,
109
 
 which would mean to go back to <code class="code">`Sending_body</code>, or to finish
110
 
 the body completely, by going to <code class="code">`End</code>.
111
 
<p>
112
 
 
113
 
 Extension for multi-part response messages (e.g. needed for
114
 
 server push, not yet implemented):<ul>
115
 
<li><code class="code">`Sending_part_header</code>: The header of a message part is being
116
 
   sent</li>
117
 
<li><code class="code">`Sent_part_header</code>: The header of a message part has been
118
 
   completely sent</li>
119
 
<li><code class="code">`Sending_part_body</code>: The body of a message part is being
120
 
   sent</li>
121
 
<li><code class="code">`Sent_part_body</code>: The body of a message part has been sent
122
 
   up to a check point</li>
123
 
</ul>
124
 
<br>
125
 
</div>
126
 
 
127
 
<pre><span class="keyword">type</span> <a name="TYPEprotocol_version"></a><code class="type"></code>protocol_version = <code class="type">Nethttp.protocol_version</code> </pre>
128
 
<div class="info">
129
 
Now defined in <code class="code">Nethttp</code><br>
130
 
</div>
131
 
 
132
 
<pre><span class="keyword">type</span> <a name="TYPEprotocol_attribute"></a><code class="type"></code>protocol_attribute = <code class="type">Nethttp.protocol_attribute</code> </pre>
133
 
<div class="info">
134
 
Now defined in <code class="code">Nethttp</code><br>
135
 
</div>
136
 
 
137
 
<pre><span class="keyword">type</span> <a name="TYPEprotocol"></a><code class="type"></code>protocol = <code class="type">Nethttp.protocol</code> </pre>
138
 
<div class="info">
139
 
Now defined in <code class="code">Nethttp</code><br>
140
 
</div>
141
 
 
142
 
<pre><span class="keyword">type</span> <a name="TYPEworkaround"></a><code class="type"></code>workaround = <code class="type">[ `Work_around_MSIE_Content_type_bug | `Work_around_backslash_bug ]</code> </pre>
143
 
<div class="info">
144
 
Indicates special behaviour:<ul>
145
 
<li><code class="code">`Work_around_MSIE_Content_type_bug</code>: Versions of the Internet
146
 
   Explorer send illegal content types. This workaround extracts
147
 
   the right data from the malformed data field</li>
148
 
<li><code class="code">`Work_around_backslash_bug</code>: Almost all browsers send illegal
149
 
   backslash sequences when backslashes occur in filenames.
150
 
   This workaround accepts such sequences.</li>
151
 
</ul>
152
 
<br>
153
 
</div>
154
 
 
155
 
<br><code><span class="keyword">type</span> <a name="TYPEcgi_config"></a><code class="type"></code>cgi_config = {</code><table class="typetable">
156
 
<tr>
157
 
<td align="left" valign="top" >
158
 
<code>&nbsp;&nbsp;</code></td>
159
 
<td align="left" valign="top" >
160
 
<code>tmp_directory&nbsp;: <code class="type">string</code>;</code></td>
161
 
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The directory where to create temporary files. This should be
162
 
 an absolute path name</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
163
 
</tr>
164
 
<tr>
165
 
<td align="left" valign="top" >
166
 
<code>&nbsp;&nbsp;</code></td>
167
 
<td align="left" valign="top" >
168
 
<code>tmp_prefix&nbsp;: <code class="type">string</code>;</code></td>
169
 
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The name prefix for temporary files. This must be a non-empty
170
 
 string. It must not contain '/'.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
171
 
</tr>
172
 
<tr>
173
 
<td align="left" valign="top" >
174
 
<code>&nbsp;&nbsp;</code></td>
175
 
<td align="left" valign="top" >
176
 
<code>permitted_http_methods&nbsp;: <code class="type">string list</code>;</code></td>
177
 
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The list of accepted HTTP methods (uppercase letters)</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
178
 
</tr>
179
 
<tr>
180
 
<td align="left" valign="top" >
181
 
<code>&nbsp;&nbsp;</code></td>
182
 
<td align="left" valign="top" >
183
 
<code>permitted_input_content_types&nbsp;: <code class="type">string list</code>;</code></td>
184
 
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The list of accepted content types in requests.
185
 
 Content type parameters (like "charset") are ignored.
186
 
 If the list is empty, all content types are allowed.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
187
 
</tr>
188
 
<tr>
189
 
<td align="left" valign="top" >
190
 
<code>&nbsp;&nbsp;</code></td>
191
 
<td align="left" valign="top" >
192
 
<code>input_content_length_limit&nbsp;: <code class="type">int</code>;</code></td>
193
 
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The maximum size of the request</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
194
 
</tr>
195
 
<tr>
196
 
<td align="left" valign="top" >
197
 
<code>&nbsp;&nbsp;</code></td>
198
 
<td align="left" valign="top" >
199
 
<code>workarounds&nbsp;: <code class="type"><a href="Netcgi_env.html#TYPEworkaround">workaround</a> list</code>;</code></td>
200
 
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The list of enabled workarounds</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
201
 
</tr></table>
202
 
}
203
 
 
204
 
 
205
 
<pre><span class="keyword">val</span> <a name="VALdefault_config"></a>default_config : <code class="type"><a href="Netcgi_env.html#TYPEcgi_config">cgi_config</a></code></pre><div class="info">
206
 
The default configuration is:<ul>
207
 
<li><code class="code">tmp_directory</code>: one of /var/tmp, /tmp, C:\temp, .</li>
208
 
<li><code class="code">tmp_prefix</code>: "netstring"</li>
209
 
<li><code class="code">permitted_http_methods</code>: <code class="code">"GET"</code>, <code class="code">"POST"</code></li>
210
 
<li><code class="code">permitted_input_content_types</code>: <code class="code">"multipart/form-data"</code>, 
211
 
     <code class="code">"application/x-www-form-urlencoded"</code></li>
212
 
<li><code class="code">input_content_length_limit</code>: <code class="code">maxint</code></li>
213
 
<li><code class="code">workarounds</code>: all</li>
214
 
</ul>
215
 
 
216
 
 To create a custom configuration, it is suggested to use this
217
 
 syntax:
218
 
 <pre><code class="code"> let custom_config =
219
 
    { default_config with tmp_prefix = "my_prefix" }
220
 
 </code></pre><br>
221
 
</div>
222
 
<pre><span class="keyword">class type</span> <a name="TYPEcgi_environment"></a><a href="Netcgi_env.cgi_environment.html">cgi_environment</a> = <code class="code">object</code> <a href="Netcgi_env.cgi_environment.html">..</a> <code class="code">end</code></pre><div class="info">
223
 
The class type cgi_environment contains the resources by which
224
 
 the CGI activation is connected to the "outer world".
225
 
</div>
226
 
<pre><span class="keyword">exception</span> <a name="EXCEPTIONStd_environment_not_found"></a>Std_environment_not_found</pre>
227
 
<div class="info">
228
 
Indicates that the process environment does not contain the
229
 
 variables that are typical of CGI<br>
230
 
</div>
231
 
<pre><span class="keyword">class</span> <a name="TYPEstd_environment"></a><a href="Netcgi_env.std_environment.html">std_environment</a> : <code class="type">?config:<a href="Netcgi_env.html#TYPEcgi_config">cgi_config</a> -> unit -> </code><code class="type"><a href="Netcgi_env.cgi_environment.html">cgi_environment</a></code></pre><div class="info">
232
 
An implementation of <code class="code">cgi_environment</code>, intended to be used
233
 
 for classical CGI.
234
 
</div>
235
 
<pre><span class="keyword">class</span> <a name="TYPEtest_environment"></a><a href="Netcgi_env.test_environment.html">test_environment</a> : <code class="type">?config:<a href="Netcgi_env.html#TYPEcgi_config">cgi_config</a> -> unit -> </code><code class="type"><a href="Netcgi_env.cgi_environment.html">cgi_environment</a></code></pre><div class="info">
236
 
An implementation of <code class="code">cgi_environment</code>, intended to test CGI
237
 
 programs from the command-line.
238
 
</div>
239
 
<pre><span class="keyword">class</span> <a name="TYPEcustom_environment"></a><a href="Netcgi_env.custom_environment.html">custom_environment</a> : <code class="type">?config:<a href="Netcgi_env.html#TYPEcgi_config">cgi_config</a> -> unit -> </code><code class="code">object</code> <a href="Netcgi_env.custom_environment.html">..</a> <code class="code">end</code></pre><div class="info">
240
 
This class can be used to set up non-standard environments.
241
 
</div>
242
 
</body></html>
 
 
b'\\ No newline at end of file'