Browse Source

Update documentation

bel 10 năm trước cách đây
mục cha
commit
6ccd32a060
5 tập tin đã thay đổi với 15 bổ sung6 xóa
  1. 1 0
      Makefile
  2. 4 3
      RELEASE_NOTES.md
  3. 1 0
      docs/Building.md
  4. 6 3
      include/civetweb.h
  5. 3 0
      src/civetweb.c

+ 1 - 0
Makefile

@@ -165,6 +165,7 @@ help:
 	@echo "   NO_CGI                disable CGI support"
 	@echo "   NO_SSL                disable SSL functionality"
 	@echo "   NO_SSL_DL             link against system libssl library"
+    @echo "   NO_FILES              do not serve files from a directory"
 	@echo "   MAX_REQUEST_SIZE      maximum header size, default 16384"
 	@echo ""
 	@echo " Variables"

+ 4 - 3
RELEASE_NOTES.md

@@ -5,16 +5,17 @@ Release Notes v1.7 (Under Development)
 Changes
 -------
 
+- Rewrite and comment request handling function
 - Specify in detail and document return values of callback functions
 - Set names for all threads (unless NO_THREAD_NAME is defined)
 - New API functions for TCP/HTTP clients
 - Fix upload of huge files
 - Allow multiple SSL instances within one application
-- Improve API and user docu
-- Allow to chose betwen static and dynamic Lua library
+- Improve API and user documentation
+- Allow to chose between static and dynamic Lua library
 - Improve unit test
 - Use temporary file name for partially uploaded files
-- Addtional API functions exported to C++
+- Additional API functions exported to C++
 - Add a websocket client example
 - Add a websocket client API
 - Update websocket example

+ 1 - 0
docs/Building.md

@@ -96,6 +96,7 @@ make build COPT="-DNDEBUG -DNO_CGI"
 | NO_CGI                    | disable CGI support                  |
 | NO_SSL                    | disable SSL functionality            |
 | NO_SSL_DL                 | link against system libssl library   |
+| NO_FILES                  | do not serve files from a directory  |
 | SQLITE_DISABLE_LFS        | disables large files (Lua only)      |
 
 ## Cross Compiling

+ 6 - 3
include/civetweb.h

@@ -84,9 +84,12 @@ struct mg_request_info {
    https://github.com/bel2125/civetweb/blob/master/docs/UserManual.md */
 struct mg_callbacks {
     /* Called when civetweb has received new HTTP request.
-       If callback returns non-zero,
-       callback must process the request by sending valid HTTP headers and
-       body, and civetweb will not do any further processing.
+       If the callback returns one, it must process the request
+       by sending valid HTTP headers and a body. Civetweb will not do
+       any further processing. Otherwise it must return zero.
+       Note that since V1.7 the "begin_request" function is called
+       before an authorization check. If an authorization check is
+       required, use a request_handler instead.
        Return value:
          0: civetweb will process the request itself. In this case,
             the callback must not send any data to the client.

+ 3 - 0
src/civetweb.c

@@ -5927,6 +5927,9 @@ static void handle_request(struct mg_connection *conn)
 
     /* 4. call a "handle everything" callback, if registered */
     if (conn->ctx->callbacks.begin_request != NULL) {
+        /* Note that since V1.7 the "begin_request" function is called
+           before an authorization check. If an authorization check is
+           required, use a request_handler instead. */
         i = conn->ctx->callbacks.begin_request(conn);
         switch (i) {
         case 1: