[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r27024 - in libmicrohttpd: doc/examples src/daemon src/exam
From: |
gnunet |
Subject: |
[GNUnet-SVN] r27024 - in libmicrohttpd: doc/examples src/daemon src/examples src/include src/include/plibc src/testcurl/https |
Date: |
Sun, 5 May 2013 20:01:10 +0200 |
Author: grothoff
Date: 2013-05-05 20:01:09 +0200 (Sun, 05 May 2013)
New Revision: 27024
Modified:
libmicrohttpd/doc/examples/sessions.c
libmicrohttpd/src/daemon/basicauth.c
libmicrohttpd/src/daemon/connection.c
libmicrohttpd/src/daemon/daemon.c
libmicrohttpd/src/daemon/digestauth.c
libmicrohttpd/src/daemon/internal.c
libmicrohttpd/src/daemon/internal.h
libmicrohttpd/src/daemon/memorypool.c
libmicrohttpd/src/daemon/memorypool.h
libmicrohttpd/src/daemon/postprocessor.c
libmicrohttpd/src/daemon/response.c
libmicrohttpd/src/daemon/test_daemon.c
libmicrohttpd/src/daemon/test_postprocessor.c
libmicrohttpd/src/daemon/test_postprocessor_large.c
libmicrohttpd/src/examples/https_fileserver_example.c
libmicrohttpd/src/examples/post_example.c
libmicrohttpd/src/include/microhttpd.h
libmicrohttpd/src/include/plibc/plibc.h
libmicrohttpd/src/testcurl/https/tls_test_common.c
libmicrohttpd/src/testcurl/https/tls_test_common.h
Log:
-improvements to docs
Modified: libmicrohttpd/doc/examples/sessions.c
===================================================================
--- libmicrohttpd/doc/examples/sessions.c 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/doc/examples/sessions.c 2013-05-05 18:01:09 UTC (rev
27024)
@@ -522,6 +522,7 @@
*
* @param cls argument given together with the function
* pointer when the handler was registered with MHD
+ * @param connection handle to connection which is being processed
* @param url the requested url
* @param method the HTTP method used ("GET", "PUT", etc.)
* @param version the HTTP version string (i.e. "HTTP/1.1")
@@ -535,7 +536,7 @@
* @param upload_data_size set initially to the size of the
* upload_data provided; the method must update this
* value to the number of bytes NOT processed;
- * @param con_cls pointer that the callback can set to some
+ * @param ptr pointer that the callback can set to some
* address and that will be preserved by MHD for future
* calls for this request; since the access handler may
* be called many times (i.e., for a PUT/POST operation
Modified: libmicrohttpd/src/daemon/basicauth.c
===================================================================
--- libmicrohttpd/src/daemon/basicauth.c 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/daemon/basicauth.c 2013-05-05 18:01:09 UTC (rev
27024)
@@ -100,10 +100,14 @@
/**
- * Queues a response to request basic authentication from the client
+ * Queues a response to request basic authentication from the client.
+ * The given response object is expected to include the payload for
+ * the response; the "WWW-Authenticate" header will be added and the
+ * response queued with the 'UNAUTHORIZED' status code.
*
* @param connection The MHD connection structure
* @param realm the realm presented to the client
+ * @param response response object to modify and queue
* @return MHD_YES on success, MHD_NO otherwise
*/
int
Modified: libmicrohttpd/src/daemon/connection.c
===================================================================
--- libmicrohttpd/src/daemon/connection.c 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/daemon/connection.c 2013-05-05 18:01:09 UTC (rev
27024)
@@ -1107,7 +1107,7 @@
}
return NULL;
}
- /* found, check if we have proper CRLF */
+ /* found, check if we have proper LFCR */
if (('\r' == rbuf[pos]) && ('\n' == rbuf[pos + 1]))
rbuf[pos++] = '\0'; /* skip both r and n */
rbuf[pos++] = '\0';
Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c 2013-05-05 12:01:06 UTC (rev 27023)
+++ libmicrohttpd/src/daemon/daemon.c 2013-05-05 18:01:09 UTC (rev 27024)
@@ -95,7 +95,7 @@
* @param cls unused
* @param file name of the file with the problem
* @param line line number with the problem
- * @param msg error message with details
+ * @param reason error message with details
*/
static void
mhd_panic_std (void *cls,
@@ -722,7 +722,7 @@
/**
* Callback for receiving data from the socket.
*
- * @param conn the MHD connection structure
+ * @param connection the MHD connection structure
* @param other where to write received data to
* @param i maximum size of other (in bytes)
* @return number of bytes actually received
@@ -747,7 +747,7 @@
/**
* Callback for writing data to the socket.
*
- * @param conn the MHD connection structure
+ * @param connection the MHD connection structure
* @param other data to write
* @param i number of bytes to write
* @return actual number of bytes written
@@ -803,6 +803,9 @@
/**
* Signature of main function for a thread.
+ *
+ * @param cls closure argument for the function
+ * @return termination code from the thread
*/
typedef void *(*ThreadStartRoutine)(void *cls);
@@ -817,7 +820,7 @@
* @return 0 on success
*/
static int
-create_thread (pthread_t * thread,
+create_thread (pthread_t *thread,
const struct MHD_Daemon *daemon,
ThreadStartRoutine start_routine,
void *arg)
@@ -1057,29 +1060,22 @@
gnutls_transport_set_ptr (connection->tls_session,
(gnutls_transport_ptr_t) connection);
gnutls_transport_set_pull_function (connection->tls_session,
- (gnutls_pull_func) &
- recv_param_adapter);
+ (gnutls_pull_func)
&recv_param_adapter);
gnutls_transport_set_push_function (connection->tls_session,
- (gnutls_push_func) &
- send_param_adapter);
+ (gnutls_push_func)
&send_param_adapter);
- if (daemon->https_mem_trust){
- gnutls_certificate_server_set_request(connection->tls_session,
GNUTLS_CERT_REQUEST);
- }
+ if (daemon->https_mem_trust)
+ gnutls_certificate_server_set_request(connection->tls_session,
GNUTLS_CERT_REQUEST);
}
#endif
if (0 != pthread_mutex_lock(&daemon->cleanup_connection_mutex))
- {
- MHD_PANIC ("Failed to acquire cleanup mutex\n");
- }
+ MHD_PANIC ("Failed to acquire cleanup mutex\n");
DLL_insert (daemon->connections_head,
daemon->connections_tail,
connection);
if (0 != pthread_mutex_unlock(&daemon->cleanup_connection_mutex))
- {
- MHD_PANIC ("Failed to release cleanup mutex\n");
- }
+ MHD_PANIC ("Failed to release cleanup mutex\n");
/* attempt to create handler thread */
if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
@@ -1742,6 +1738,7 @@
/**
* Start a webserver on the given port.
*
+ * @param flags combination of MHD_FLAG values
* @param port port to bind to
* @param apc callback to call to check which clients
* will be allowed to connect
@@ -1751,7 +1748,7 @@
* @return NULL on error, handle to daemon on success
*/
struct MHD_Daemon *
-MHD_start_daemon (unsigned int options,
+MHD_start_daemon (unsigned int flags,
uint16_t port,
MHD_AcceptPolicyCallback apc,
void *apc_cls,
@@ -1761,7 +1758,7 @@
va_list ap;
va_start (ap, dh_cls);
- daemon = MHD_start_daemon_va (options, port, apc, apc_cls, dh, dh_cls, ap);
+ daemon = MHD_start_daemon_va (flags, port, apc, apc_cls, dh, dh_cls, ap);
va_end (ap);
return daemon;
}
@@ -2163,16 +2160,19 @@
/**
* Start a webserver on the given port.
*
+ * @param flags combination of MHD_FLAG values
* @param port port to bind to
* @param apc callback to call to check which clients
* will be allowed to connect
* @param apc_cls extra argument to apc
* @param dh default handler for all URIs
* @param dh_cls extra argument to dh
+ * @param ap list of options (type-value pairs,
+ * terminated with MHD_OPTION_END).
* @return NULL on error, handle to daemon on success
*/
struct MHD_Daemon *
-MHD_start_daemon_va (unsigned int options,
+MHD_start_daemon_va (unsigned int flags,
uint16_t port,
MHD_AcceptPolicyCallback apc,
void *apc_cls,
@@ -2193,15 +2193,15 @@
int use_pipe;
#ifndef HAVE_INET6
- if (0 != (options & MHD_USE_IPv6))
+ if (0 != (flags & MHD_USE_IPv6))
return NULL;
#endif
#ifndef HAVE_POLL_H
- if (0 != (options & MHD_USE_POLL))
+ if (0 != (flags & MHD_USE_POLL))
return NULL;
#endif
#if ! HTTPS_SUPPORT
- if (0 != (options & MHD_USE_SSL))
+ if (0 != (flags & MHD_USE_SSL))
return NULL;
#endif
if (NULL == dh)
@@ -2211,7 +2211,7 @@
memset (daemon, 0, sizeof (struct MHD_Daemon));
/* try to open listen socket */
#if HTTPS_SUPPORT
- if (0 != (options & MHD_USE_SSL))
+ if (0 != (flags & MHD_USE_SSL))
{
gnutls_priority_init (&daemon->priority_cache,
"NORMAL",
@@ -2219,7 +2219,7 @@
}
#endif
daemon->socket_fd = -1;
- daemon->options = (enum MHD_OPTION) options;
+ daemon->options = (enum MHD_OPTION) flags;
daemon->port = port;
daemon->apc = apc;
daemon->apc_cls = apc_cls;
@@ -2252,7 +2252,7 @@
return NULL;
}
#ifndef WINDOWS
- if ( (0 == (options & MHD_USE_POLL)) &&
+ if ( (0 == (flags & MHD_USE_POLL)) &&
(daemon->wpipe[0] >= FD_SETSIZE) )
{
#if HAVE_MESSAGES
@@ -2271,7 +2271,7 @@
daemon->nonce_nc_size = 4; /* tiny */
#endif
#if HTTPS_SUPPORT
- if (0 != (options & MHD_USE_SSL))
+ if (0 != (flags & MHD_USE_SSL))
{
daemon->cred_type = GNUTLS_CRD_CERTIFICATE;
}
@@ -2281,7 +2281,7 @@
if (MHD_YES != parse_options_va (daemon, &servaddr, ap))
{
#if HTTPS_SUPPORT
- if ( (0 != (options & MHD_USE_SSL)) &&
+ if ( (0 != (flags & MHD_USE_SSL)) &&
(NULL != daemon->priority_cache) )
gnutls_priority_deinit (daemon->priority_cache);
#endif
@@ -2299,7 +2299,7 @@
"Specified value for NC_SIZE too large\n");
#endif
#if HTTPS_SUPPORT
- if (0 != (options & MHD_USE_SSL))
+ if (0 != (flags & MHD_USE_SSL))
gnutls_priority_deinit (daemon->priority_cache);
#endif
free (daemon);
@@ -2314,7 +2314,7 @@
STRERROR (errno));
#endif
#if HTTPS_SUPPORT
- if (0 != (options & MHD_USE_SSL))
+ if (0 != (flags & MHD_USE_SSL))
gnutls_priority_deinit (daemon->priority_cache);
#endif
free (daemon);
@@ -2329,7 +2329,7 @@
"MHD failed to initialize nonce-nc mutex\n");
#endif
#if HTTPS_SUPPORT
- if (0 != (options & MHD_USE_SSL))
+ if (0 != (flags & MHD_USE_SSL))
gnutls_priority_deinit (daemon->priority_cache);
#endif
free (daemon->nnc);
@@ -2339,7 +2339,7 @@
#endif
/* Thread pooling currently works only with internal select thread model */
- if ( (0 == (options & MHD_USE_SELECT_INTERNALLY)) &&
+ if ( (0 == (flags & MHD_USE_SELECT_INTERNALLY)) &&
(daemon->worker_pool_size > 0) )
{
#if HAVE_MESSAGES
@@ -2350,7 +2350,7 @@
}
#ifdef __SYMBIAN32__
- if (0 != (options & (MHD_USE_SELECT_INTERNALLY |
MHD_USE_THREAD_PER_CONNECTION)))
+ if (0 != (flags & (MHD_USE_SELECT_INTERNALLY |
MHD_USE_THREAD_PER_CONNECTION)))
{
#if HAVE_MESSAGES
MHD_DLOG (daemon,
@@ -2363,14 +2363,14 @@
(0 == (daemon->options & MHD_USE_NO_LISTEN_SOCKET)) )
{
/* try to open listen socket */
- if ((options & MHD_USE_IPv6) != 0)
+ if ((flags & MHD_USE_IPv6) != 0)
socket_fd = create_socket (PF_INET6, SOCK_STREAM, 0);
else
socket_fd = create_socket (PF_INET, SOCK_STREAM, 0);
if (-1 == socket_fd)
{
#if HAVE_MESSAGES
- if (0 != (options & MHD_USE_DEBUG))
+ if (0 != (flags & MHD_USE_DEBUG))
MHD_DLOG (daemon,
"Call to socket failed: %s\n",
STRERROR (errno));
@@ -2380,7 +2380,7 @@
if ((SETSOCKOPT (socket_fd,
SOL_SOCKET,
SO_REUSEADDR,
- &on, sizeof (on)) < 0) && ((options & MHD_USE_DEBUG) !=
0))
+ &on, sizeof (on)) < 0) && ((flags & MHD_USE_DEBUG) != 0))
{
#if HAVE_MESSAGES
MHD_DLOG (daemon,
@@ -2391,7 +2391,7 @@
/* check for user supplied sockaddr */
#if HAVE_INET6
- if (0 != (options & MHD_USE_IPv6))
+ if (0 != (flags & MHD_USE_IPv6))
addrlen = sizeof (struct sockaddr_in6);
else
#endif
@@ -2399,7 +2399,7 @@
if (NULL == servaddr)
{
#if HAVE_INET6
- if (0 != (options & MHD_USE_IPv6))
+ if (0 != (flags & MHD_USE_IPv6))
{
memset (&servaddr6, 0, sizeof (struct sockaddr_in6));
servaddr6.sin6_family = AF_INET6;
@@ -2423,7 +2423,7 @@
}
daemon->socket_fd = socket_fd;
- if (0 != (options & MHD_USE_IPv6))
+ if (0 != (flags & MHD_USE_IPv6))
{
#ifdef IPPROTO_IPV6
#ifdef IPV6_V6ONLY
@@ -2448,7 +2448,7 @@
if (-1 == BIND (socket_fd, servaddr, addrlen))
{
#if HAVE_MESSAGES
- if (0 != (options & MHD_USE_DEBUG))
+ if (0 != (flags & MHD_USE_DEBUG))
MHD_DLOG (daemon,
"Failed to bind to port %u: %s\n",
(unsigned int) port,
@@ -2461,7 +2461,7 @@
if (LISTEN (socket_fd, 20) < 0)
{
#if HAVE_MESSAGES
- if (0 != (options & MHD_USE_DEBUG))
+ if (0 != (flags & MHD_USE_DEBUG))
MHD_DLOG (daemon,
"Failed to listen for connections: %s\n",
STRERROR (errno));
@@ -2476,10 +2476,10 @@
}
#ifndef WINDOWS
if ( (socket_fd >= FD_SETSIZE) &&
- (0 == (options & MHD_USE_POLL)) )
+ (0 == (flags & MHD_USE_POLL)) )
{
#if HAVE_MESSAGES
- if ((options & MHD_USE_DEBUG) != 0)
+ if ((flags & MHD_USE_DEBUG) != 0)
MHD_DLOG (daemon,
"Socket descriptor larger than FD_SETSIZE: %d > %d\n",
socket_fd,
@@ -2514,7 +2514,7 @@
#if HTTPS_SUPPORT
/* initialize HTTPS daemon certificate aspects & send / recv functions */
- if ((0 != (options & MHD_USE_SSL)) && (0 != MHD_TLS_init (daemon)))
+ if ((0 != (flags & MHD_USE_SSL)) && (0 != MHD_TLS_init (daemon)))
{
#if HAVE_MESSAGES
MHD_DLOG (daemon,
@@ -2527,8 +2527,8 @@
goto free_and_fail;
}
#endif
- if ( ( (0 != (options & MHD_USE_THREAD_PER_CONNECTION)) ||
- ( (0 != (options & MHD_USE_SELECT_INTERNALLY)) &&
+ if ( ( (0 != (flags & MHD_USE_THREAD_PER_CONNECTION)) ||
+ ( (0 != (flags & MHD_USE_SELECT_INTERNALLY)) &&
(0 == daemon->worker_pool_size)) ) &&
(0 == (daemon->options & MHD_USE_NO_LISTEN_SOCKET)) &&
(0 != (res_thread_create =
@@ -2671,7 +2671,7 @@
pthread_mutex_destroy (&daemon->nnc_lock);
#endif
#if HTTPS_SUPPORT
- if (0 != (options & MHD_USE_SSL))
+ if (0 != (flags & MHD_USE_SSL))
gnutls_priority_deinit (daemon->priority_cache);
#endif
free (daemon);
Modified: libmicrohttpd/src/daemon/digestauth.c
===================================================================
--- libmicrohttpd/src/daemon/digestauth.c 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/daemon/digestauth.c 2013-05-05 18:01:09 UTC (rev
27024)
@@ -736,6 +736,9 @@
* @param connection The MHD connection structure
* @param realm the realm presented to the client
* @param opaque string to user for opaque value
+ * @param response reply to send; should contain the "access denied"
+ * body; note that this function will set the "WWW Authenticate"
+ * header and that the caller should not do this
* @param signal_stale MHD_YES if the nonce is invalid to add
* 'stale=true' to the authentication header
* @return MHD_YES on success, MHD_NO otherwise
Modified: libmicrohttpd/src/daemon/internal.c
===================================================================
--- libmicrohttpd/src/daemon/internal.c 2013-05-05 12:01:06 UTC (rev 27023)
+++ libmicrohttpd/src/daemon/internal.c 2013-05-05 18:01:09 UTC (rev 27024)
@@ -111,6 +111,7 @@
*
* @param cls closure (use NULL)
* @param connection handle to connection, not used
+ * @param val value to unescape (modified in the process)
* @return length of the resulting val (strlen(val) maybe
* shorter afterwards due to elimination of escape sequences)
*/
Modified: libmicrohttpd/src/daemon/internal.h
===================================================================
--- libmicrohttpd/src/daemon/internal.h 2013-05-05 12:01:06 UTC (rev 27023)
+++ libmicrohttpd/src/daemon/internal.h 2013-05-05 18:01:09 UTC (rev 27024)
@@ -57,14 +57,14 @@
/**
* Trigger 'panic' action based on fatal errors.
*
- * @param error message (const char *)
+ * @param msg error message (const char *)
*/
#define MHD_PANIC(msg) mhd_panic (mhd_panic_cls, __FILE__, __LINE__, msg)
#else
/**
* Trigger 'panic' action based on fatal errors.
*
- * @param error message (const char *)
+ * @param msg error message (const char *)
*/
#define MHD_PANIC(msg) mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL)
#endif
@@ -156,6 +156,7 @@
*
* @param cls closure (use NULL)
* @param connection handle to connection, not used
+ * @param val value to unescape (modified in the process)
* @return length of the resulting val (strlen(val) maybe
* shorter afterwards due to elimination of escape sequences)
*/
Modified: libmicrohttpd/src/daemon/memorypool.c
===================================================================
--- libmicrohttpd/src/daemon/memorypool.c 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/daemon/memorypool.c 2013-05-05 18:01:09 UTC (rev
27024)
@@ -81,6 +81,7 @@
* Create a memory pool.
*
* @param max maximum size of the pool
+ * @return NULL on error
*/
struct MemoryPool *
MHD_pool_create (size_t max)
@@ -119,6 +120,8 @@
/**
* Destroy a memory pool.
+ *
+ * @param pool memory pool to destroy
*/
void
MHD_pool_destroy (struct MemoryPool *pool)
@@ -135,6 +138,12 @@
/**
* Allocate size bytes from the pool.
+ *
+ * @param pool memory pool to use for the operation
+ * @param size number of bytes to allocate
+ * @param from_end allocate from end of pool (set to MHD_YES);
+ * use this for small, persistent allocations that
+ * will never be reallocated
* @return NULL if the pool cannot support size more
* bytes
*/
@@ -170,6 +179,7 @@
* allocation may be leaked until the pool is
* destroyed (and copying the data maybe required).
*
+ * @param pool memory pool to use for the operation
* @param old the existing block
* @param old_size the size of the existing block
* @param new_size the new size of the block
@@ -223,6 +233,7 @@
* Clear all entries from the memory pool except
* for "keep" of the given "size".
*
+ * @param pool memory pool to use for the operation
* @param keep pointer to the entry to keep (maybe NULL)
* @param size how many bytes need to be kept at this address
* @return addr new address of "keep" (if it had to change)
Modified: libmicrohttpd/src/daemon/memorypool.h
===================================================================
--- libmicrohttpd/src/daemon/memorypool.h 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/daemon/memorypool.h 2013-05-05 18:01:09 UTC (rev
27024)
@@ -42,6 +42,7 @@
* Create a memory pool.
*
* @param max maximum size of the pool
+ * @return NULL on error
*/
struct MemoryPool *
MHD_pool_create (size_t max);
@@ -49,6 +50,8 @@
/**
* Destroy a memory pool.
+ *
+ * @param pool memory pool to destroy
*/
void
MHD_pool_destroy (struct MemoryPool *pool);
@@ -57,6 +60,8 @@
/**
* Allocate size bytes from the pool.
*
+ * @param pool memory pool to use for the operation
+ * @param size number of bytes to allocate
* @param from_end allocate from end of pool (set to MHD_YES);
* use this for small, persistent allocations that
* will never be reallocated
@@ -77,6 +82,7 @@
* allocation may be leaked until the pool is
* destroyed (and copying the data maybe required).
*
+ * @param pool memory pool to use for the operation
* @param old the existing block
* @param old_size the size of the existing block
* @param new_size the new size of the block
@@ -95,6 +101,7 @@
* Clear all entries from the memory pool except
* for "keep" of the given "size".
*
+ * @param pool memory pool to use for the operation
* @param keep pointer to the entry to keep (maybe NULL)
* @param size how many bytes need to be kept at this address
* @return addr new address of "keep" (if it had to change)
Modified: libmicrohttpd/src/daemon/postprocessor.c
===================================================================
--- libmicrohttpd/src/daemon/postprocessor.c 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/daemon/postprocessor.c 2013-05-05 18:01:09 UTC (rev
27024)
@@ -71,19 +71,19 @@
RN_Inactive = 0,
/**
- * If the next character is '\n', skip it. Otherwise,
+ * If the next character is CR, skip it. Otherwise,
* just go inactive.
*/
RN_OptN = 1,
/**
- * Expect '\r\n' (and only '\r\n'). As always, we also
- * expect only '\r' or only '\n'.
+ * Expect LFCR (and only LFCR). As always, we also
+ * expect only LF or only CR.
*/
RN_Full = 2,
/**
- * Expect either '\r\n' or '--\r\n'. If '--\r\n', transition into dash-state
+ * Expect either LFCR or '--'LFCR. If '--'LFCR, transition into dash-state
* for the main state machine
*/
RN_Dash = 3,
@@ -221,9 +221,9 @@
enum PP_State state;
/**
- * Side-state-machine: skip '\r\n' (or just '\n').
+ * Side-state-machine: skip LRCR (or just LF).
* Set to 0 if we are not in skip mode. Set to 2
- * if a '\r\n' is expected, set to 1 if a '\n' should
+ * if a LFCR is expected, set to 1 if a CR should
* be skipped if it is the next character.
*/
enum RN_State skip_rn;
@@ -256,22 +256,22 @@
* specifically the parsing of the keys). A
* tiny value (256-1024) should be sufficient.
* Do NOT use 0.
- * @param ikvi iterator to be called with the parsed data
- * @param cls first argument to ikvi
+ * @param iter iterator to be called with the parsed data
+ * @param iter_cls first argument to iter
* @return NULL on error (out of memory, unsupported encoding),
* otherwise a PP handle
*/
struct MHD_PostProcessor *
MHD_create_post_processor (struct MHD_Connection *connection,
size_t buffer_size,
- MHD_PostDataIterator ikvi, void *cls)
+ MHD_PostDataIterator iter, void *iter_cls)
{
struct MHD_PostProcessor *ret;
const char *encoding;
const char *boundary;
size_t blen;
- if ((buffer_size < 256) || (connection == NULL) || (ikvi == NULL))
+ if ((buffer_size < 256) || (connection == NULL) || (iter == NULL))
mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL);
encoding = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
@@ -312,8 +312,8 @@
return NULL;
memset (ret, 0, sizeof (struct MHD_PostProcessor) + buffer_size + 1);
ret->connection = connection;
- ret->ikvi = ikvi;
- ret->cls = cls;
+ ret->ikvi = iter;
+ ret->cls = iter_cls;
ret->encoding = encoding;
ret->buffer_size = buffer_size;
ret->state = PP_Init;
@@ -508,6 +508,15 @@
/**
*
* @param pp post processor context
+ * @param boundary boundary to look for
+ * @param blen number of bytes in boundary
+ * @param ioffptr set to the end of the boundary if found,
+ * otherwise incremented by one (FIXME: quirky API!)
+ * @param next_state state to which we should advance the post processor
+ * if the boundary is found
+ * @param next_dash_state dash_state to which we should advance the
+ * post processor if the boundary is found
+ * @return MHD_NO if the boundary is not found, MHD_YES if we did find it
*/
static int
find_boundary (struct MHD_PostProcessor *pp,
@@ -595,6 +604,8 @@
* @param pp post processor context
* @param ioffptr set to how many bytes have been
* processed
+ * @param next_state state to which the post processor should
+ * be advanced if we find the end of the headers
* @return MHD_YES if we can continue processing,
* MHD_NO on error or if we do not have
* enough data yet
@@ -617,7 +628,7 @@
}
if (newline == pp->buffer_pos)
return MHD_NO; /* will need more data */
- if (newline == 0)
+ if (0 == newline)
{
/* empty line - end of headers */
pp->skip_rn = RN_Full;
@@ -652,6 +663,7 @@
* process accordingly.
*
* @param pp post processor context
+ * @param ioffptr incremented based on the number of bytes processed
* @param boundary the boundary to look for
* @param blen strlen(boundary)
* @param next_state what state to go into after the
@@ -707,7 +719,7 @@
/* cannot check for boundary, process content that
we have and check again later; except, if we have
no content, abort (out of memory) */
- if ((newline == 0) && (pp->buffer_pos == pp->buffer_size))
+ if ((0 == newline) && (pp->buffer_pos == pp->buffer_size))
{
pp->state = PP_Error;
return MHD_NO;
@@ -745,23 +757,23 @@
static void
free_unmarked (struct MHD_PostProcessor *pp)
{
- if ((pp->content_name != NULL) && (0 == (pp->have & NE_content_name)))
+ if ((NULL != pp->content_name) && (0 == (pp->have & NE_content_name)))
{
free (pp->content_name);
pp->content_name = NULL;
}
- if ((pp->content_type != NULL) && (0 == (pp->have & NE_content_type)))
+ if ((NULL != pp->content_type) && (0 == (pp->have & NE_content_type)))
{
free (pp->content_type);
pp->content_type = NULL;
}
- if ((pp->content_filename != NULL) &&
+ if ((NULL != pp->content_filename) &&
(0 == (pp->have & NE_content_filename)))
{
free (pp->content_filename);
pp->content_filename = NULL;
}
- if ((pp->content_transfer_encoding != NULL) &&
+ if ((NULL != pp->content_transfer_encoding) &&
(0 == (pp->have & NE_content_transfer_encoding)))
{
free (pp->content_transfer_encoding);
@@ -774,6 +786,9 @@
* Decode multipart POST data.
*
* @param pp post processor context
+ * @param post_data data to decode
+ * @param post_data_len number of bytes in 'post_data'
+ * @return MHD_NO on error,
*/
static int
post_process_multipart (struct MHD_PostProcessor *pp,
Modified: libmicrohttpd/src/daemon/response.c
===================================================================
--- libmicrohttpd/src/daemon/response.c 2013-05-05 12:01:06 UTC (rev 27023)
+++ libmicrohttpd/src/daemon/response.c 2013-05-05 18:01:09 UTC (rev 27024)
@@ -158,6 +158,7 @@
/**
* Get all of the headers added to a response.
*
+ * @param response response to query
* @param iterator callback to call on each header;
* maybe NULL (then just count headers)
* @param iterator_cls extra argument to iterator
@@ -185,11 +186,13 @@
/**
* Get a particular header from the response.
*
+ * @param response response to query
* @param key which header to get
* @return NULL if header does not exist
*/
const char *
-MHD_get_response_header (struct MHD_Response *response, const char *key)
+MHD_get_response_header (struct MHD_Response *response,
+ const char *key)
{
struct MHD_HTTP_Header *pos;
@@ -296,7 +299,7 @@
*
* @param size size of the data portion of the response
* @param fd file descriptor referring to a file on disk with the data
- * @param off offset to start reading from in the file
+ * @param offset offset to start reading from in the file
* @return NULL on error (i.e. invalid arguments, out of memory)
*/
struct MHD_Response *MHD_create_response_from_fd_at_offset (size_t size,
Modified: libmicrohttpd/src/daemon/test_daemon.c
===================================================================
--- libmicrohttpd/src/daemon/test_daemon.c 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/daemon/test_daemon.c 2013-05-05 18:01:09 UTC (rev
27024)
@@ -19,7 +19,7 @@
*/
/**
- * @file daemon_test.c
+ * @file test_daemon.c
* @brief Testcase for libmicrohttpd starts and stops
* @author Christian Grothoff
*/
Modified: libmicrohttpd/src/daemon/test_postprocessor.c
===================================================================
--- libmicrohttpd/src/daemon/test_postprocessor.c 2013-05-05 12:01:06 UTC
(rev 27023)
+++ libmicrohttpd/src/daemon/test_postprocessor.c 2013-05-05 18:01:09 UTC
(rev 27024)
@@ -19,7 +19,7 @@
*/
/**
- * @file postprocessor_test.c
+ * @file test_postprocessor.c
* @brief Testcase for postprocessor
* @author Christian Grothoff
*/
Modified: libmicrohttpd/src/daemon/test_postprocessor_large.c
===================================================================
--- libmicrohttpd/src/daemon/test_postprocessor_large.c 2013-05-05 12:01:06 UTC
(rev 27023)
+++ libmicrohttpd/src/daemon/test_postprocessor_large.c 2013-05-05 18:01:09 UTC
(rev 27024)
@@ -19,7 +19,7 @@
*/
/**
- * @file postprocessor_large_test.c
+ * @file test_postprocessor_large.c
* @brief Testcase with very large input for postprocessor
* @author Christian Grothoff
*/
Modified: libmicrohttpd/src/examples/https_fileserver_example.c
===================================================================
--- libmicrohttpd/src/examples/https_fileserver_example.c 2013-05-05
12:01:06 UTC (rev 27023)
+++ libmicrohttpd/src/examples/https_fileserver_example.c 2013-05-05
18:01:09 UTC (rev 27024)
@@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
/**
- * @file https_server_example.c
+ * @file https_fileserver_example.c
* @brief a simple HTTPS file server using TLS.
*
* Usage :
Modified: libmicrohttpd/src/examples/post_example.c
===================================================================
--- libmicrohttpd/src/examples/post_example.c 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/examples/post_example.c 2013-05-05 18:01:09 UTC (rev
27024)
@@ -492,9 +492,9 @@
/**
* Main MHD callback for handling requests.
*
- *
* @param cls argument given together with the function
* pointer when the handler was registered with MHD
+ * @param connection handle identifying the incoming connection
* @param url the requested url
* @param method the HTTP method used ("GET", "PUT", etc.)
* @param version the HTTP version string (i.e. "HTTP/1.1")
@@ -508,7 +508,7 @@
* @param upload_data_size set initially to the size of the
* upload_data provided; the method must update this
* value to the number of bytes NOT processed;
- * @param con_cls pointer that the callback can set to some
+ * @param ptr pointer that the callback can set to some
* address and that will be preserved by MHD for future
* calls for this request; since the access handler may
* be called many times (i.e., for a PUT/POST operation
Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/include/microhttpd.h 2013-05-05 18:01:09 UTC (rev
27024)
@@ -66,7 +66,7 @@
* "platform.h" in the MHD distribution). If you have done so, you
* should also have a line with "#define MHD_PLATFORM_H" which will
* prevent this header from trying (and, depending on your platform,
- * failing) to #include the right headers.
+ * failing) to include the right headers.
*/
#ifndef MHD_MICROHTTPD_H
@@ -1066,12 +1066,12 @@
* @param apc_cls extra argument to apc
* @param dh handler called for all requests (repeatedly)
* @param dh_cls extra argument to dh
- * @param ... list of options (type-value pairs,
+ * @param ap list of options (type-value pairs,
* terminated with MHD_OPTION_END).
* @return NULL on error, handle to daemon on success
*/
struct MHD_Daemon *
-MHD_start_daemon_va (unsigned int options,
+MHD_start_daemon_va (unsigned int flags,
uint16_t port,
MHD_AcceptPolicyCallback apc, void *apc_cls,
MHD_AccessHandlerCallback dh, void *dh_cls,
@@ -1458,7 +1458,7 @@
* @param fd file descriptor referring to a file on disk with the
* data; will be closed when response is destroyed;
* fd should be in 'blocking' mode
- * @param off offset to start reading from in the file;
+ * @param offset offset to start reading from in the file;
* Be careful! 'off_t' may have been compiled to be a
* 64-bit variable for MHD, in which case your application
* also has to be compiled using the same options! Read
@@ -1655,6 +1655,7 @@
MHD_del_response_header (struct MHD_Response *response,
const char *header, const char *content);
+
/**
* Get all of the headers (and footers) added to a response.
*
@@ -1702,14 +1703,14 @@
* performance, use 32 or 64k (i.e. 65536).
* @param iter iterator to be called with the parsed data,
* Must NOT be NULL.
- * @param cls first argument to ikvi
+ * @param iter_cls first argument to iter
* @return NULL on error (out of memory, unsupported encoding),
* otherwise a PP handle
*/
struct MHD_PostProcessor *
MHD_create_post_processor (struct MHD_Connection *connection,
size_t buffer_size,
- MHD_PostDataIterator iter, void *cls);
+ MHD_PostDataIterator iter, void *iter_cls);
/**
* Parse and process POST data.
@@ -1818,9 +1819,13 @@
/**
* Queues a response to request basic authentication from the client
+ * The given response object is expected to include the payload for
+ * the response; the "WWW-Authenticate" header will be added and the
+ * response queued with the 'UNAUTHORIZED' status code.
*
* @param connection The MHD connection structure
* @param realm the realm presented to the client
+ * @param response response object to modify and queue
* @return MHD_YES on success, MHD_NO otherwise
*/
int
Modified: libmicrohttpd/src/include/plibc/plibc.h
===================================================================
--- libmicrohttpd/src/include/plibc/plibc.h 2013-05-05 12:01:06 UTC (rev
27023)
+++ libmicrohttpd/src/include/plibc/plibc.h 2013-05-05 18:01:09 UTC (rev
27024)
@@ -18,7 +18,7 @@
*/
/**
- * @file include/plibc.h
+ * @file plibc.h
* @brief PlibC header
* @attention This file is usually not installed under Unix,
* so ship it with your application
Modified: libmicrohttpd/src/testcurl/https/tls_test_common.c
===================================================================
--- libmicrohttpd/src/testcurl/https/tls_test_common.c 2013-05-05 12:01:06 UTC
(rev 27023)
+++ libmicrohttpd/src/testcurl/https/tls_test_common.c 2013-05-05 18:01:09 UTC
(rev 27024)
@@ -252,10 +252,13 @@
return CURLE_OK;
}
+
/**
* compile test file url pointing to the current running directory path
+ *
* @param url - char buffer into which the url is compiled
- * @return
+ * @param port port to use for the test
+ * @return -1 on error
*/
int
gen_test_file_url (char *url, int port)
Modified: libmicrohttpd/src/testcurl/https/tls_test_common.h
===================================================================
--- libmicrohttpd/src/testcurl/https/tls_test_common.h 2013-05-05 12:01:06 UTC
(rev 27023)
+++ libmicrohttpd/src/testcurl/https/tls_test_common.h 2013-05-05 18:01:09 UTC
(rev 27024)
@@ -98,6 +98,14 @@
const char *version, size_t *upload_data_size,
void **ptr);
+
+/**
+ * compile test file url pointing to the current running directory path
+ *
+ * @param url - char buffer into which the url is compiled
+ * @param port port to use for the test
+ * @return -1 on error
+ */
int gen_test_file_url (char *url, int port);
int
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r27024 - in libmicrohttpd: doc/examples src/daemon src/examples src/include src/include/plibc src/testcurl/https,
gnunet <=