[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4272 - libmicrohttpd/src/include
From: |
grothoff |
Subject: |
[GNUnet-SVN] r4272 - libmicrohttpd/src/include |
Date: |
Tue, 9 Jan 2007 17:02:59 -0800 (PST) |
Author: grothoff
Date: 2007-01-09 17:02:58 -0800 (Tue, 09 Jan 2007)
New Revision: 4272
Modified:
libmicrohttpd/src/include/microhttpd.h
Log:
syn
Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h 2007-01-09 20:54:00 UTC (rev
4271)
+++ libmicrohttpd/src/include/microhttpd.h 2007-01-10 01:02:58 UTC (rev
4272)
@@ -57,6 +57,11 @@
#define MHD_NO 0
+#define MHD_HTTP_OK 200
+
+#define MHD_HTTP_NOT_FOUND 404
+
+
/**
* Options for the MHD daemon. Note that if neither
* MHD_USER_THREAD_PER_CONNECTION nor MHD_USE_SELECT_INTERNALLY are
@@ -110,6 +115,39 @@
MHD_USE_IPv6 = 32,
};
+/**
+ * The MHD_ValueKind specifies the source of
+ * the key-value pairs in the HTTP protocol.
+ */
+enum MHD_ValueKind {
+
+ /**
+ * Response header
+ */
+ MHD_RESPONSE_HEADER_KIND = 0;
+
+ /**
+ * HTTP header
+ */
+ MHD_HEADER_KIND = 1;
+
+ /**
+ * Cookies
+ */
+ MHD_COOKIE_KIND = 2;
+
+ /**
+ * POST data
+ */
+ MHD_POSTDATA_KIND = 4;
+
+ /**
+ * GET (URI) arguments
+ */
+ MHD_GET_ARGUMENT_KIND = 8;
+
+};
+
struct MHD_Daemon;
struct MHD_Session;
@@ -131,9 +169,9 @@
/**
* A client has requested the given url using the given method ("GET",
- * "PUT" or "POST"). The callback must call MHS callbacks to provide
- * content to give back to the client and return an HTTP status code
- * (i.e. 200 for OK, 404, etc.).
+ * "PUT", "DELETE", "POST", etc). The callback must call MHS
+ * callbacks to provide content to give back to the client and return
+ * an HTTP status code (i.e. 200 for OK, 404, etc.).
*
* @return MHS_YES if the connection was handled successfully,
* MHS_NO if the socket must be closed due to a serios
@@ -157,6 +195,7 @@
*/
typedef int
(*MHD_KeyValueIterator)(void * cls,
+ enum MHD_ValueKind kind,
const char * key,
const char * value);
@@ -239,7 +278,7 @@
MHD_get_fdset(struct MHD_Daemon * daemon,
fd_set * read_fd_set,
fd_set * write_fd_set,
- fd_set * exc_fd_set,
+ fd_set * except_fd_set,
int * max_fd);
/**
@@ -292,44 +331,24 @@
* @return number of entries iterated over
*/
int
-MHD_get_session_headers(struct MHD_Session * session,
- MHD_KeyValueIterator * iterator,
- void * iterator_cls);
+MHD_get_session_values(struct MHD_Session * session,
+ enum MHD_ValueKind kind,
+ MHD_KeyValueIterator * iterator,
+ void * iterator_cls);
/**
- * Get a particular header value.
+ * Get a particular header value. If multiple
+ * values match the kind, return any one of them.
*
* @param key the header to look for
* @return NULL if no such item was found
*/
const char *
-MHD_lookup_session_header(struct MHD_Session * session,
- const char * key);
+MHD_lookup_session_value(struct MHD_Session * session,
+ enum MHD_ValueKind kind,
+ const char * key);
/**
- * Get all of the form fields from POST.
- *
- * @param iterator callback to call on each header;
- * maybe NULL (then just count headers)
- * @param iterator_cls extra argument to iterator
- * @return number of entries iterated over
- */
-int
-MHD_get_post_items(struct MHD_Session * session,
- MHD_KeyValueIterator * iterator,
- void * iterator_cls);
-
-/**
- * Get a particular form field from POST.
- *
- * @param key the field to look for
- * @return NULL if no such item was found
- */
-const char *
-MHD_lookup_post_item(struct MHD_Session * session,
- const char * key);
-
-/**
* Queue a response to be transmitted to the client (as soon as
* possible).
*
@@ -343,6 +362,7 @@
MHD_queue_response(struct MHD_Session * session,
unsigned int status_code,
struct MHD_Response * response);
+
/**
* Create a response object. The response object can be extended with
@@ -420,6 +440,18 @@
MHD_KeyValueIterator * iterator,
void * iterator_cls);
+/**
+ * FIXME-CHRIS
+ * @return -1 if no data uploaded; otherwise number of bytes
+ * read into buf; 0 for end of transmission
+ */
+int
+MHD_read_file_upload(struct MHD_Session * session,
+ void * buf,
+ size_t len);
+
+
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4272 - libmicrohttpd/src/include,
grothoff <=