[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14399 - libmicrohttpd-docs/WWW
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14399 - libmicrohttpd-docs/WWW |
Date: |
Sun, 13 Feb 2011 11:36:29 +0100 |
Author: grothoff
Date: 2011-02-13 11:36:29 +0100 (Sun, 13 Feb 2011)
New Revision: 14399
Modified:
libmicrohttpd-docs/WWW/microhttpd.html
libmicrohttpd-docs/WWW/microhttpd.pdf
Log:
update
Modified: libmicrohttpd-docs/WWW/microhttpd.html
===================================================================
--- libmicrohttpd-docs/WWW/microhttpd.html 2011-02-13 10:31:51 UTC (rev
14398)
+++ libmicrohttpd-docs/WWW/microhttpd.html 2011-02-13 10:36:29 UTC (rev
14399)
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd">
<html>
-<!-- This manual documents GNU libmicrohttpd version 0.9.4, last
-updated 25 December 2010. It is built upon the documentation in the
+<!-- This manual documents GNU libmicrohttpd version 0.9.7, last
+updated 7 February 2011. It is built upon the documentation in the
header file microhttpd.h.
@@ -16,7 +16,7 @@
GNU libmicrohttpd is a GNU package.
-->
-<!-- Created on December 25, 2010 by texi2html 1.82
+<!-- Created on February 13, 2011 by texi2html 1.82
texi2html was written by:
Lionel Cons <address@hidden> (original author)
Karl Berry <address@hidden>
@@ -66,8 +66,8 @@
</tr></table>
<a name="The-GNU-libmicrohttpd-Library"></a>
<h1 class="settitle">The GNU libmicrohttpd Library</h1>
-<p>This manual documents GNU libmicrohttpd version 0.9.4, last
-updated 25 December 2010. It is built upon the documentation in the
+<p>This manual documents GNU libmicrohttpd version 0.9.7, last
+updated 7 February 2011. It is built upon the documentation in the
header file ‘<tt>microhttpd.h</tt>’.
</p>
@@ -335,7 +335,7 @@
<dd><p>Options for the <acronym>MHD</acronym> daemon.
</p>
<p>Note that if neither <code>MHD_USER_THREAD_PER_CONNECTION</code> nor
-<code>MHD_USE_SELECT_INTERNALLY</code> are used, the client wants control over
+<code>MHD_USE_SELECT_INTERNALLY</code> is used, the client wants control over
the process and will call the appropriate microhttpd callbacks.
</p>
<p>Starting the daemon may also fail if a particular option is not
@@ -420,7 +420,7 @@
</dd>
<dt> <code>MHD_OPTION_CONNECTION_LIMIT</code></dt>
<dd><a name="index-connection_002c-limiting-number-of-connections"></a>
-<p>Maximum number of concurrenct connections to accept (followed by an
+<p>Maximum number of concurrent connections to accept (followed by an
<code>unsigned int</code>). The default is <code>FD_SETSIZE - 4</code> (the
maximum number of file descriptors supported by <code>select</code> minus
four for <code>stdin</code>, <code>stdout</code>, <code>stderr</code> and the
server
@@ -485,7 +485,7 @@
<code>struct sockaddr *</code>. If <code>MHD_USE_IPv6</code> is specified,
the <code>struct sockaddr*</code> should point to a <code>struct
sockaddr_in6</code>,
otherwise to a <code>struct sockaddr_in</code>. If this option is not
specified,
-the daemon will listen to incomming connections from anywhere.
+the daemon will listen to incoming connections from anywhere.
</p>
</dd>
<dt> <code>MHD_OPTION_URI_LOG_CALLBACK</code></dt>
@@ -538,7 +538,7 @@
This option should be followed by an "const char*" argument.
The presence of this option activates the request of certificate
to the client. The request to the client is marked optional, and
-it is the responsability of the server to check the presence
+it is the responsibility of the server to check the presence
of the certificate if needed.
Note that most browsers will only present a client certificate
only if they have one matching the specified CA, not sending
@@ -558,7 +558,7 @@
<a name="index-TLS-4"></a>
<a name="index-cipher"></a>
<p>SSL/TLS protocol version and ciphers.
-This option must be followwed by an "const char *" argument
+This option must be followed by an "const char *" argument
specifying the SSL/TLS protocol versions and ciphers that
are acceptable for the application. The string is passed
unchanged to gnutls_priority_init. If this option is not
@@ -574,7 +574,7 @@
type "size_t" which specifies the size of the buffer pointed to by
the
second argument in bytes. Note that the application must ensure that
the buffer of the second argument remains allocated and unmodified
-while the deamon is running. For security, you SHOULD provide a fresh
+while the daemon is running. For security, you SHOULD provide a fresh
random nonce when using MHD with Digest Authentication.
</p>
</dd>
@@ -778,7 +778,36 @@
</dd></dl>
+<dl>
+<dt><a name="index-MHD_005fResponseMemoryMode"></a><u>Enumeration:</u>
<b>MHD_ResponseMemoryMode</b></dt>
+<dd><p>The <code>MHD_ResponeMemoryMode</code> specifies how MHD should treat
+the memory buffer given for the response in
+<code>MHD_create_response_from_buffer</code>.
+</p>
+<dl compact="compact">
+<dt> <code>MHD_RESPMEM_PERSISTENT</code></dt>
+<dd><p>Buffer is a persistent (static/global) buffer that won’t change
+for at least the lifetime of the response, MHD should just use
+it, not free it, not copy it, just keep an alias to it.
+</p>
+</dd>
+<dt> <code>MHD_RESPMEM_MUST_FREE</code></dt>
+<dd><p>Buffer is heap-allocated with <code>malloc</code> (or equivalent) and
+should be freed by MHD after processing the response has
+concluded (response reference counter reaches zero).
+</p>
+</dd>
+<dt> <code>MHD_RESPMEM_MUST_COPY</code></dt>
+<dd><p>Buffer is in transient memory, but not on the heap (for example,
+on the stack or non-malloc allocated) and only valid during the
+call to <code>MHD_create_response_from_buffer</code>. MHD must make its
+own private copy of the data for processing.
+</p>
+</dd>
+</dl>
+</dd></dl>
+
<dl>
<dt><a name="index-MHD_005fConnectionInfoType"></a><u>Enumeration:</u>
<b>MHD_ConnectionInfoType</b></dt>
<dd><p>Values of this enum are used to specify what information about a
@@ -786,18 +815,34 @@
</p>
<dl compact="compact">
<dt> <code>MHD_CONNECTION_INFO_CIPHER_ALGO</code></dt>
-<dd><p>What cipher algorithm is being used.
+<dd><p>What cipher algorithm is being used (HTTPS connections only).
Takes no extra arguments.
+NULL is returned for non-HTTPS connections.
</p>
</dd>
<dt> <code>MHD_CONNECTION_INFO_PROTOCOL,</code></dt>
<dd><p>Takes no extra arguments. Allows finding out the TLS/SSL protocol used
(HTTPS connections only).
+NULL is returned for non-HTTPS connections.
</p>
</dd>
+<dt> <code>MHD_CONNECTION_INFO_CLIENT_ADDRESS</code></dt>
+<dd><p>Returns information about the address of the client. Returns
+essentially a <code>struct sockaddr **</code> (since the API returns
+a <code>union MHD_ConnectionInfo *</code> and that union contains
+a <code>struct sockaddr *</code>).
+</p>
+</dd>
<dt> <code>MHD_CONNECTION_INFO_GNUTLS_SESSION,</code></dt>
<dd><p>Takes no extra arguments. Allows access to the underlying GNUtls
session,
including access to the underlying GNUtls client certificate
+(HTTPS connections only). Takes no extra arguments.
+NULL is returned for non-HTTPS connections.
+</p>
+</dd>
+<dt> <code>MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT,</code></dt>
+<dd><p>Takes no extra arguments. Allows access to the client certificate
+including access to the underlying GNUtls client certificate
(HTTPS connections only). Takes no extra arguments.
</p>
</dd>
@@ -810,7 +855,7 @@
<dl>
<dt><a name="index-MHD_005fDaemonInfoType"></a><u>Enumeration:</u>
<b>MHD_DaemonInfoType</b></dt>
<dd><p>Values of this enum are used to specify what
-information about a deamon is desired.
+information about a daemon is desired.
</p><dl compact="compact">
<dt> <code>MHD_DAEMON_INFO_KEY_SIZE</code></dt>
<dd><p>Request information about the key size for a particular cipher
@@ -1202,7 +1247,7 @@
</p>
<dl compact="compact">
<dt> <var>cb</var> </dt>
-<dd><p>function to call if MHD encounteres a fatal internal error. If no
handler was set explicitly, MHD will call <code>abort</code>.
+<dd><p>function to call if MHD encounters a fatal internal error. If no
handler was set explicitly, MHD will call <code>abort</code>.
</p>
</dd>
<dt> <var>cls</var></dt>
@@ -1447,7 +1492,7 @@
</p>
<p>Example: we allocate a new <code>MHD_Response</code> structure for each
response <strong>kind</strong>, we use it every time we have to give that
-responce and we finally destroy it only when the daemon shuts down.
+response and we finally destroy it only when the daemon shuts down.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a
href="#microhttpd_002dresponse-enqueue">8.1 Enqueuing a
response</a></td><td> </td><td align="left" valign="top"></td></tr>
@@ -1513,7 +1558,7 @@
<dd><p>Destroy a response object and associated resources (decrement the
reference counter). Note that <acronym>MHD</acronym> may keep some of the
resources
around if the response is still in the queue for some clients, so the
-memory may not necessarily be freed immediatley.
+memory may not necessarily be freed immediately.
</p></dd></dl>
@@ -1523,7 +1568,7 @@
<li>
a <code>MHD_Response</code> object is allocated:
-<table><tr><td> </td><td><pre class="example">struct MHD_Response *
response = MHD_create_response_from_data(...);
+<table><tr><td> </td><td><pre class="example">struct MHD_Response *
response = MHD_create_response_from_buffer(...);
/* here: reference counter = 1 */
</pre></td></tr></table>
@@ -1611,6 +1656,8 @@
<dt><a
name="index-MHD_005fcreate_005fresponse_005ffrom_005ffd"></a><u>Function:</u>
struct MHD_Response * <b>MHD_create_response_from_fd</b><i> (uint64_t size, int
fd)</i></dt>
<dd><p>Create a response object. The response object can be extended with
header information and then it can be used any number of times.
+Function is deprecated, use <code>MHD_create_response_from_fd_at_offset</code>
+instead (with an offset of zero).
</p>
<dl compact="compact">
<dt> <var>size</var></dt>
@@ -1658,9 +1705,38 @@
<dl>
+<dt><a
name="index-MHD_005fcreate_005fresponse_005ffrom_005fbuffer"></a><u>Function:</u>
struct MHD_Response * <b>MHD_create_response_from_buffer</b><i> (size_t size,
void *data, enum MHD_ResponseMemoryMode mode)</i></dt>
+<dd><p>Create a response object. The response object can be extended with
+header information and then it can be used any number of times.
+</p>
+<dl compact="compact">
+<dt> <var>size</var></dt>
+<dd><p>size of the data portion of the response;
+</p>
+</dd>
+<dt> <var>buffer</var></dt>
+<dd><p>the data itself;
+</p>
+</dd>
+<dt> <var>mode</var> </dt>
+<dd><p>memory management options for buffer; use
+MHD_RESPMEM_PERSISTENT if the buffer is static/global memory,
+use MHD_RESPMEM_MUST_FREE if the buffer is heap-allocated and
+should be freed by <acronym>MHD</acronym> and MHD_RESPMEM_MUST_COPY if the
+buffer is in transient memory (i.e. on the stack) and must
+be copied by <acronym>MHD</acronym>;
+</p></dd>
+</dl>
+
+<p>Return <code>NULL</code> on error (i.e. invalid arguments, out of memory).
+</p></dd></dl>
+
+
+<dl>
<dt><a
name="index-MHD_005fcreate_005fresponse_005ffrom_005fdata"></a><u>Function:</u>
struct MHD_Response * <b>MHD_create_response_from_data</b><i> (size_t size,
void *data, int must_free, int must_copy)</i></dt>
<dd><p>Create a response object. The response object can be extended with
header information and then it can be used any number of times.
+This function is deprecated, use <code>MHD_create_response_from_buffer</code>
instead.
</p>
<dl compact="compact">
<dt> <var>size</var></dt>
@@ -1694,8 +1770,8 @@
struct MHD_Connection * connection = ...;
struct MHD_Response * response;
-response = MHD_create_response_from_data(strlen(data), data,
- MHD_NO, MHD_NO);
+response = MHD_create_response_from_buffer (strlen(data), data,
+ MHD_RESPMEM_PERSISTENT);
MHD_queue_response(connection, 404, response);
MHD_destroy_response(response);
</pre></td></tr></table>
@@ -1842,7 +1918,7 @@
between the client and the server, so this method must only be used
for non-sensitive content or when the session is protected with https.
When using basic authentication <acronym>MHD</acronym> will have access to the
clear
-password, possibily allowing to create a chained authentication
+password, possibly allowing to create a chained authentication
toward an external authentication server.
</p>
<p>Digest authentication uses a one-way authentication method based
@@ -1996,9 +2072,9 @@
username = MHD_digest_auth_get_username(connection);
if (username == NULL)
{
- response = MHD_create_response_from_data(strlen (DENIED),
- DENIED,
- MHD_NO, MHD_NO);
+ response = MHD_create_response_from_buffer(strlen (DENIED),
+ DENIED,
+ MHD_RESPMEM_PERSISTENT);
ret = MHD_queue_auth_fail_response(connection, realm,
OPAQUE,
response,
@@ -2014,9 +2090,9 @@
if ( (ret == MHD_INVALID_NONCE) ||
(ret == MHD_NO) )
{
- response = MHD_create_response_from_data(strlen (DENIED),
- DENIED,
- MHD_NO, MHD_NO);
+ response = MHD_create_response_from_buffer(strlen (DENIED),
+ DENIED,
+ MHD_RESPMEM_PERSISTENT);
if (NULL == response)
return MHD_NO;
ret = MHD_queue_auth_fail_response(connection, realm,
@@ -2026,8 +2102,8 @@
MHD_destroy_response(response);
return ret;
}
- response = MHD_create_response_from_data(strlen(PAGE), PAGE,
- MHD_NO, MHD_NO);
+ response = MHD_create_response_from_buffer (strlen(PAGE), PAGE,
+ MHD_RESPMEM_PERSISTENT);
ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
MHD_destroy_response(response);
return ret;
@@ -2062,7 +2138,7 @@
</table>
-<p><acronym>MHD</acronym> provides the post procesor API to make it easier for
applications to
+<p><acronym>MHD</acronym> provides the post processor API to make it easier
for applications to
parse the data of a client’s <code>POST</code> request: the
<code>MHD_AccessHandlerCallback</code> will be invoked multiple times to
process data as it arrives; at each invocation a new chunk of data must
@@ -2077,7 +2153,7 @@
this is a new request.
</p>
<p>One method to detect that a new connection was established is
-to set <code>*con_cls</code> to anunused integer:
+to set <code>*con_cls</code> to an unused integer:
</p>
<table><tr><td> </td><td><pre class="example">int
access_handler (void *cls,
@@ -2369,6 +2445,8 @@
+
+
<hr size="6">
<a name="GNU_002dLGPL"></a>
<table cellpadding="1" cellspacing="1" border="0">
@@ -4107,6 +4185,7 @@
<tr><td></td><td valign="top"><a
href="#index-MHD_005fadd_005fresponse_005fheader"><code>MHD_add_response_header</code></a></td><td
valign="top"><a href="#microhttpd_002dresponse-headers">8.3 Adding headers to
a response</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-MHD_005fbasic_005fauth_005fget_005fusername_005fpassword"><code>MHD_basic_auth_get_username_password</code></a></td><td
valign="top"><a href="#microhttpd_002ddauth-basic">9.1 Using Basic
Authentication</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-MHD_005fcreate_005fpost_005fprocessor"><code>MHD_create_post_processor</code></a></td><td
valign="top"><a href="#microhttpd_002dpost-api">10.1 Programming interface for
the <code>POST</code> processor</a></td></tr>
+<tr><td></td><td valign="top"><a
href="#index-MHD_005fcreate_005fresponse_005ffrom_005fbuffer"><code>MHD_create_response_from_buffer</code></a></td><td
valign="top"><a href="#microhttpd_002dresponse-create">8.2 Creating a response
object</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-MHD_005fcreate_005fresponse_005ffrom_005fcallback"><code>MHD_create_response_from_callback</code></a></td><td
valign="top"><a href="#microhttpd_002dresponse-create">8.2 Creating a response
object</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-MHD_005fcreate_005fresponse_005ffrom_005fdata"><code>MHD_create_response_from_data</code></a></td><td
valign="top"><a href="#microhttpd_002dresponse-create">8.2 Creating a response
object</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-MHD_005fcreate_005fresponse_005ffrom_005ffd"><code>MHD_create_response_from_fd</code></a></td><td
valign="top"><a href="#microhttpd_002dresponse-create">8.2 Creating a response
object</a></td></tr>
@@ -4182,6 +4261,7 @@
<tr><td></td><td valign="top"><a
href="#index-MHD_005fPostProcessor"><code>MHD_PostProcessor</code></a></td><td
valign="top"><a href="#microhttpd_002dstruct">3. Structures type
definition</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-MHD_005fRequestTerminationCode"><code>MHD_RequestTerminationCode</code></a></td><td
valign="top"><a href="#microhttpd_002dconst">2. Constants</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-MHD_005fResponse"><code>MHD_Response</code></a></td><td
valign="top"><a href="#microhttpd_002dstruct">3. Structures type
definition</a></td></tr>
+<tr><td></td><td valign="top"><a
href="#index-MHD_005fResponseMemoryMode"><code>MHD_ResponseMemoryMode</code></a></td><td
valign="top"><a href="#microhttpd_002dconst">2. Constants</a></td></tr>
<tr><td></td><td valign="top"><a
href="#index-MHD_005fValueKind"><code>MHD_ValueKind</code></a></td><td
valign="top"><a href="#microhttpd_002dconst">2. Constants</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
</table>
@@ -4300,7 +4380,7 @@
</tr></table>
<h1>About This Document</h1>
<p>
- This document was generated by <em>Christian Grothoff</em> on <em>December
25, 2010</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html
1.82</em></a>.
+ This document was generated by <em>Christian Grothoff</em> on <em>February
13, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html
1.82</em></a>.
</p>
<p>
The buttons in the navigation panels have the following meaning:
@@ -4402,7 +4482,7 @@
<hr size="1">
<p>
<font size="-1">
- This document was generated by <em>Christian Grothoff</em> on <em>December
25, 2010</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html
1.82</em></a>.
+ This document was generated by <em>Christian Grothoff</em> on <em>February
13, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html
1.82</em></a>.
</font>
<br>
Modified: libmicrohttpd-docs/WWW/microhttpd.pdf
===================================================================
(Binary files differ)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14399 - libmicrohttpd-docs/WWW,
gnunet <=