summaryrefslogtreecommitdiffstats
path: root/nanohttp
diff options
context:
space:
mode:
Diffstat (limited to 'nanohttp')
-rw-r--r--nanohttp/nanohttp-client.h8
-rwxr-xr-xnanohttp/nanohttp-mime.h46
-rw-r--r--nanohttp/nanohttp-server.h43
3 files changed, 89 insertions, 8 deletions
diff --git a/nanohttp/nanohttp-client.h b/nanohttp/nanohttp-client.h
index 9c72fe1..d993c34 100644
--- a/nanohttp/nanohttp-client.h
+++ b/nanohttp/nanohttp-client.h
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: nanohttp-client.h,v 1.37 2006/12/13 08:26:01 m0gg Exp $
+ * $Id: nanohttp-client.h,v 1.38 2007/01/01 18:58:05 m0gg Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -375,6 +375,12 @@ extern herror_t httpc_post_end(httpc_conn_t * conn, hresponse_t ** out);
/**
*
+ * @todo move to nanohttp-mime.c merge with httpc_mime_* functions
+ *
+ */
+
+/**
+ *
* Begin MIME multipart/related POST request
*
* @return H_OK on success or error flag
diff --git a/nanohttp/nanohttp-mime.h b/nanohttp/nanohttp-mime.h
index 6ea0ef8..0edc5ca 100755
--- a/nanohttp/nanohttp-mime.h
+++ b/nanohttp/nanohttp-mime.h
@@ -3,7 +3,7 @@
* | \/ | | | | \/ | | _/
* |_''_| |_| |_''_| |_'/ PARSER
*
-* $Id: nanohttp-mime.h,v 1.14 2006/12/09 09:27:11 m0gg Exp $
+* $Id: nanohttp-mime.h,v 1.15 2007/01/01 18:58:05 m0gg Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -28,10 +28,50 @@
#ifndef __nanohttp_mime_h
#define __nanohttp_mime_h
-/** @file
+/** @page nanohttp_mime_page nanoHTTP MIME attachments
+ *
+ * @section Table of contents
+ *
+ * - @ref nanohttp_mime_client_sec
+ * - @ref nanohttp_mime_client_init_sec
+ * - @ref nanohttp_mime_client_request_sec
+ * - @ref nanohttp_mime_client_response_sec
+ * - @ref nanohttp_mime_client_cleanup_sec
+ * - @ref nanohttp_mime_server_sec
+ * - @ref nanohttp_mime_server_init_sec
+ * - @ref nanohttp_mime_server_cleanup_sec
+ *
+ * @section nanohttp_mime_client_sec nanoHTTP client with MIME attachments
+ *
+ * @subsection nanohttp_mime_client_init_sec Client initialization
+ *
+ * See @ref nanohttp_client_init_sec for more information about client
+ * initialization.
+ *
+ * @subsection nanohttp_mime_client_request_sec Request the server
+ *
+ * The following functions can be used to transmit MIME attachments:
+ *
+ * @code
+ * httpc_mime_begin(conn, url, start_id, "", "text/tml")
+ * httpc_mime_next(conn, start_id, "text/xml", "binary")
+ * http_output_stream_write(conn->out, buffer, size)
+ * http_mime_send_file()
+ * http_mime_end(conn, &res)
+ * @endcode
+ *
+ * @subsection nanohttp_mime_client_response_sec Read the server response
+ *
+ * @subsection nanohttp_mime_client_cleanup_sec Client cleanup
+ *
+ * @secion nanohttp_mime_server_sec nanoHTTP server with MIME attachments
+ *
+ * @subsection nanohttp_mime_server_init_sec Server initialization
+ *
+ * @subsection nanohttp_mime_server_cleanup_sec Server cleanup
*
* @author Ferhat Ayaz
- * @version $Revision: 1.14 $
+ * @version $Revision: 1.15 $
*
* @see http://www.ietf.org/rfc/rfc2045.txt
* @see http://www.ietf.org/rfc/rfc2046.txt
diff --git a/nanohttp/nanohttp-server.h b/nanohttp/nanohttp-server.h
index bdb421c..53eb4a8 100644
--- a/nanohttp/nanohttp-server.h
+++ b/nanohttp/nanohttp-server.h
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: nanohttp-server.h,v 1.34 2006/12/31 17:24:22 m0gg Exp $
+ * $Id: nanohttp-server.h,v 1.35 2007/01/01 18:58:05 m0gg Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -321,10 +321,9 @@ extern void httpd_set_headers(httpd_conn_t * conn, hpair_t * header);
extern int httpd_add_header(httpd_conn_t * conn, const char *key, const char *value);
extern void httpd_add_headers(httpd_conn_t * conn, const hpair_t * values);
-/*
- * XXX: move to nanohttp-mime.c
+/**
*
- * MIME support httpd_mime_* function set
+ * @todo move to nanohttp-mime.c merge with httpc_mime_* functions
*
*/
@@ -359,6 +358,42 @@ extern herror_t httpd_mime_send_file(httpd_conn_t * conn, const char *content_id
*/
extern herror_t httpd_mime_end(httpd_conn_t * conn);
+/**
+ *
+ * Send a minimalistic HTML error document with HTTP status 500.
+ *
+ * @see HTTP_STATUS_500_REASON_PHRASE
+ *
+ */
+extern herror_t httpd_send_internal_error(httpd_conn_t * conn, const char *msg);
+
+/**
+ *
+ * Send a minimalistic HTML error document with HTTP status 501.
+ *
+ * @see HTTP_STATUS_501_REASON_PHRASE
+ *
+ */
+extern herror_t httpd_send_not_implemented(httpd_conn_t *conn, const char *msg);
+
+/**
+ *
+ * Send a minimalistic HTML error document with HTTP status 404.
+ *
+ * @see HTTP_STATUS_401_REASON_PHRASE
+ *
+ */
+extern herror_t httpd_send_bad_request(httpd_conn_t *conn, const char *msg);
+
+/**
+ *
+ * Send a minimalistc HTML error document with HTTP status 401.
+ *
+ * @see HTTP_STATUS_404_REASON_PHRASE
+ *
+ */
+extern herror_t httpd_send_unauthorized(httpd_conn_t *conn, const char *realm);
+
#ifdef __cplusplus
}
#endif