浏览代码

Merge branch 'master' of https://github.com/bel2125/civetweb

bel2125 9 年之前
父节点
当前提交
985d3ffbbe
共有 7 个文件被更改,包括 33 次插入5 次删除
  1. 3 0
      Makefile.osx
  2. 9 0
      RELEASE_NOTES.md
  3. 1 1
      contrib/buildroot/civetweb.mk
  4. 8 0
      docs/UserManual.md
  5. 4 4
      include/civetweb.h
  6. 6 0
      src/civetweb.c
  7. 2 0
      test/shared.c

+ 3 - 0
Makefile.osx

@@ -7,6 +7,9 @@
 # security unlock ~/Library/Keychains/login.keychain
 # See e.g. http://lists.apple.com/archives/apple-cdsa/2008/Jan/msg00027.html
 
+# Civetweb features
+WITH_LUA = 1
+
 PACKAGE = Civetweb
 BUILD_DIR = out
 

+ 9 - 0
RELEASE_NOTES.md

@@ -1,3 +1,12 @@
+Release Notes v1.9 (work in progress)
+===
+### Objectives: *TO BE DEFINED*
+
+Changes
+-------
+
+- Updated version number
+
 Release Notes v1.8
 ===
 ### Objectives: *CMake integration and continuous integration tests, Support client certificates, bug fixes*

+ 1 - 1
contrib/buildroot/civetweb.mk

@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-CIVETWEB_VERSION = 1.8
+CIVETWEB_VERSION = 1.9
 CIVETWEB_SITE = http://github.com/civetweb/civetweb/tarball/v$(CIVETWEB_VERSION)
 CIVETWEB_LICENSE = MIT
 CIVETWEB_LICENSE_FILES = LICENSE.md

+ 8 - 0
docs/UserManual.md

@@ -616,6 +616,14 @@ An example is shown in
   Solution: specify the full path to the PHP interpreter, e.g.:
     `civetweb -cgi_interpreter /full/path/to/php-cgi`
 
+- `php-cgi` is unavailable, for example on Mac OS X. As long as the `php` binary is installed, you can run CGI programs in command line mode (see the example below). Note that in this mode, `$_GET` and friends will be unavailable, and you'll have to parse the query string manually using [parse_str](http://php.net/manual/en/function.parse-str.php) and the `QUERY_STRING` environmental variable.
+
+        #!/usr/bin/php
+        <?php
+        echo "Content-Type: text/html\r\n\r\n";
+        echo "Hello World!\n";
+        ?>
+
 - Civetweb fails to start. If Civetweb exits immediately when started, this
   usually indicates a syntax error in the configuration file
   (named `civetweb.conf` by default) or the command-line arguments.

+ 4 - 4
include/civetweb.h

@@ -23,7 +23,7 @@
 #ifndef CIVETWEB_HEADER_INCLUDED
 #define CIVETWEB_HEADER_INCLUDED
 
-#define CIVETWEB_VERSION "1.8"
+#define CIVETWEB_VERSION "1.9"
 
 #ifndef CIVETWEB_API
 #if defined(_WIN32)
@@ -174,7 +174,7 @@ struct mg_callbacks {
 	   Return value:
 	     NULL: do not serve file from memory, proceed with normal file open.
 	     non-NULL: pointer to the file contents in memory. data_len must be
-	       initilized with the size of the memory block. */
+	       initialized with the size of the memory block. */
 	const char *(*open_file)(const struct mg_connection *,
 	                         const char *path,
 	                         size_t *data_len);
@@ -615,7 +615,7 @@ CIVETWEB_API void mg_send_mime_file(struct mg_connection *conn,
 /* Store body data into a file. */
 CIVETWEB_API long long mg_store_body(struct mg_connection *conn,
                                      const char *path);
-/* Read entire request body and stor it in a file "path".
+/* Read entire request body and store it in a file "path".
    Return:
      < 0   Error
      >= 0  Number of bytes stored in file "path".
@@ -907,7 +907,7 @@ CIVETWEB_API void mg_cry(const struct mg_connection *conn,
                          ...) PRINTF_ARGS(2, 3);
 
 
-/* utility methods to compare two buffers, case incensitive. */
+/* utility methods to compare two buffers, case insensitive. */
 CIVETWEB_API int mg_strcasecmp(const char *s1, const char *s2);
 CIVETWEB_API int mg_strncasecmp(const char *s1, const char *s2, size_t len);
 

+ 6 - 0
src/civetweb.c

@@ -851,6 +851,8 @@ typedef int socklen_t;
 #include <openssl/crypto.h>
 #include <openssl/x509.h>
 #include <openssl/pem.h>
+#include <openssl/engine.h>
+#include <openssl/conf.h>
 #else
 /* SSL loaded dynamically from DLL.
  * I put the prototypes here to be independent from OpenSSL source
@@ -5870,6 +5872,7 @@ connect_socket(struct mg_context *ctx /* may be NULL */,
 		return 0;
 	}
 
+#if !defined(NO_SSL_DL)
 	if (use_ssl && (SSLv23_client_method == NULL)) {
 		mg_snprintf(NULL,
 		            NULL, /* No truncation check for ebuf */
@@ -5879,6 +5882,9 @@ connect_socket(struct mg_context *ctx /* may be NULL */,
 		            "SSL is not initialized");
 		return 0;
 	}
+#else
+    (void)use_ssl;
+#endif
 
 	if (mg_inet_pton(AF_INET, host, &sa->sin, sizeof(sa->sin))) {
 		sa->sin.sin_port = htons((uint16_t)port);

+ 2 - 0
test/shared.c

@@ -19,12 +19,14 @@
  * THE SOFTWARE.
  */
 
+#ifdef _MSC_VER
 #if !defined(_CRT_SECURE_NO_WARNINGS)
 #define _CRT_SECURE_NO_WARNINGS
 #endif
 #if !defined(_CRT_SECURE_NO_DEPRECATE)
 #define _CRT_SECURE_NO_DEPRECATE
 #endif
+#endif
 
 #include "shared.h"
 #include <string.h>