浏览代码

Compile fixes for OSX

Also fixed github URL's to point to correct project.
Thomas Davis 11 年之前
父节点
当前提交
1461951d13

+ 1 - 1
RELEASE_NOTES.md

@@ -190,6 +190,6 @@ Changes
 
 
 - Renamed Mongoose to Civetweb in the code and documentation.
 - Renamed Mongoose to Civetweb in the code and documentation.
 - Replaced copyrighted images with new images
 - Replaced copyrighted images with new images
-- Created a new code respository at https://github.com/sunsetbrew/civetweb
+- Created a new code respository at https://github.com/bel2125/civetweb
 - Created a distribution site at https://sourceforge.net/projects/civetweb/
 - Created a distribution site at https://sourceforge.net/projects/civetweb/
 - Basic build testing
 - Basic build testing

+ 1 - 1
contrib/buildroot/civetweb.mk

@@ -5,7 +5,7 @@
 ################################################################################
 ################################################################################
 
 
 CIVETWEB_VERSION = 1.6
 CIVETWEB_VERSION = 1.6
-CIVETWEB_SITE = http://github.com/sunsetbrew/civetweb/tarball/v$(CIVETWEB_VERSION)
+CIVETWEB_SITE = http://github.com/bel2125/civetweb/tarball/v$(CIVETWEB_VERSION)
 CIVETWEB_LICENSE = MIT
 CIVETWEB_LICENSE = MIT
 CIVETWEB_LICENSE_FILES = LICENSE.md
 CIVETWEB_LICENSE_FILES = LICENSE.md
 
 

+ 1 - 1
distribution/arch/PKGBUILD.git.example

@@ -15,7 +15,7 @@ optdepends=('php-cgi: for php support')
 provides=("$_pkgname")
 provides=("$_pkgname")
 conflicts=("$_pkgname")
 conflicts=("$_pkgname")
 backup=("etc/$_pkgname/$_pkgname.conf")
 backup=("etc/$_pkgname/$_pkgname.conf")
-source=("$_pkgname::git+https://github.com/sunsetbrew/civetweb.git")
+source=("$_pkgname::git+https://github.com/bel2125/civetweb.git")
 md5sums=('SKIP')
 md5sums=('SKIP')
 
 
 pkgver() {
 pkgver() {

+ 3 - 3
docs/Building.md

@@ -2,10 +2,10 @@ Building Civetweb
 =========
 =========
 
 
 This guide covers the build instructions for stand-alone web server.  
 This guide covers the build instructions for stand-alone web server.  
-See [Embedding.md](https://github.com/sunsetbrew/civetweb/blob/master/docs/Embedding.md) for information on extending an application.
+See [Embedding.md](https://github.com/bel2125/civetweb/blob/master/docs/Embedding.md) for information on extending an application.
 
 
 #### Where to get the source code?
 #### Where to get the source code?
-https://github.com/sunsetbrew/civetweb
+https://github.com/bel2125/civetweb
 
 
 
 
 Building for Windows
 Building for Windows
@@ -13,7 +13,7 @@ Building for Windows
 
 
 Open the *VS2012/civetweb.sln* in Visual Studio.
 Open the *VS2012/civetweb.sln* in Visual Studio.
 To include SSL support, you may have to use yaSSL.  However, it is GPL licensed.
 To include SSL support, you may have to use yaSSL.  However, it is GPL licensed.
-See [yaSSL.md](https://github.com/sunsetbrew/civetweb/blob/master/docs/yaSSL.md) for more information.
+See [yaSSL.md](https://github.com/bel2125/civetweb/blob/master/docs/yaSSL.md) for more information.
 
 
 
 
 Building for Linux, BSD, and OSX
 Building for Linux, BSD, and OSX

+ 2 - 2
docs/Embedding.md

@@ -7,7 +7,7 @@ Files
 ------
 ------
 
 
 There is just a small set of files to compile in to the application,
 There is just a small set of files to compile in to the application,
-but if a library is desired, see [Building.md](https://github.com/sunsetbrew/civetweb/blob/master/docs/Building.md)
+but if a library is desired, see [Building.md](https://github.com/bel2125/civetweb/blob/master/docs/Building.md)
 
 
 #### Regarding the INL file extension
 #### Regarding the INL file extension
 The *INL* file extension represents code that is statically included inline in a source file.  Slightly different from C++ where it means "inline" code which is technically not the same as static code. Civetweb overloads this extension for the sake of clearity as opossed to having .c extensions on files that should not be directly compiled.
 The *INL* file extension represents code that is statically included inline in a source file.  Slightly different from C++ where it means "inline" code which is technically not the same as static code. Civetweb overloads this extension for the sake of clearity as opossed to having .c extensions on files that should not be directly compiled.
@@ -128,7 +128,7 @@ limit on number of simultaneous requests that can be handled by civetweb.
 
 
 When master thread accepts new connection, a new accepted socket (described by
 When master thread accepts new connection, a new accepted socket (described by
 `struct socket`) it placed into the accepted sockets queue,
 `struct socket`) it placed into the accepted sockets queue,
-which has size of 20 (see [code](https://github.com/sunsetbrew/civetweb/blob/3892e0199e6ca9613b160535d9d107ede09daa43/civetweb.c#L486)). Any idle worker thread
+which has size of 20 (see [code](https://github.com/bel2125/civetweb/blob/3892e0199e6ca9613b160535d9d107ede09daa43/civetweb.c#L486)). Any idle worker thread
 can grab accepted sockets from that queue. If all worker threads are busy,
 can grab accepted sockets from that queue. If all worker threads are busy,
 master thread can accept and queue up to 20 more TCP connections,
 master thread can accept and queue up to 20 more TCP connections,
 filling up the queue.
 filling up the queue.

+ 2 - 2
docs/Installing.md

@@ -1,14 +1,14 @@
 Civetweb Install Guide
 Civetweb Install Guide
 ====
 ====
 
 
-This guide covers the distributions for CivetWeb.  The latest source code is available at [https://github.com/sunsetbrew/civetweb](https://github.com/sunsetbrew/civetweb).
+This guide covers the distributions for CivetWeb.  The latest source code is available at [https://github.com/bel2125/civetweb](https://github.com/bel2125/civetweb).
 
 
 Windows
 Windows
 ---
 ---
 
 
 This pre-built version comes pre-built wit Lua support. Libraries for SSL support are not included due to licensing restrictions;
 This pre-built version comes pre-built wit Lua support. Libraries for SSL support are not included due to licensing restrictions;
 however, users may add an SSL library themselves.
 however, users may add an SSL library themselves.
-Instructions for adding SSL support can be found in [https://github.com/sunsetbrew/civetweb/tree/master/docs](https://github.com/sunsetbrew/civetweb/tree/master/docs)
+Instructions for adding SSL support can be found in [https://github.com/bel2125/civetweb/tree/master/docs](https://github.com/bel2125/civetweb/tree/master/docs)
 
 
 1. Install the [Visual C++ Redistributable for Visual Studio 2012](http://www.microsoft.com/en-us/download/details.aspx?id=30679)
 1. Install the [Visual C++ Redistributable for Visual Studio 2012](http://www.microsoft.com/en-us/download/details.aspx?id=30679)
 2. Download latest *civetweb-win.zip* from [SourceForge](https://sourceforge.net/projects/civetweb/files/)
 2. Download latest *civetweb-win.zip* from [SourceForge](https://sourceforge.net/projects/civetweb/files/)

+ 1 - 1
examples/upload/upload.c

@@ -1,5 +1,5 @@
 // Copyright (c) 2004-2012 Sergey Lyubka
 // Copyright (c) 2004-2012 Sergey Lyubka
-// This file is a part of civetweb project, http://github.com/sunsetbrew/civetweb
+// This file is a part of civetweb project, http://github.com/bel2125/civetweb
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <string.h>
 #include <string.h>

+ 1 - 1
examples/ws_server/ws_server.c

@@ -1,5 +1,5 @@
 // Copyright (c) 2004-2012 Sergey Lyubka
 // Copyright (c) 2004-2012 Sergey Lyubka
-// This file is a part of civetweb project, http://github.com/sunsetbrew/civetweb
+// This file is a part of civetweb project, http://github.com/bel2125/civetweb
 //
 //
 // v 0.1 Contributed by William Greathouse    9-Sep-2013
 // v 0.1 Contributed by William Greathouse    9-Sep-2013
 
 

+ 2 - 2
include/civetweb.h

@@ -77,7 +77,7 @@ struct mg_request_info {
 
 
 /* This structure needs to be passed to mg_start(), to let civetweb know
 /* This structure needs to be passed to mg_start(), to let civetweb know
    which callbacks to invoke. For detailed description, see
    which callbacks to invoke. For detailed description, see
-   https://github.com/sunsetbrew/civetweb/blob/master/docs/UserManual.md */
+   https://github.com/bel2125/civetweb/blob/master/docs/UserManual.md */
 struct mg_callbacks {
 struct mg_callbacks {
     /* Called when civetweb has received new HTTP request.
     /* Called when civetweb has received new HTTP request.
        If callback returns non-zero,
        If callback returns non-zero,
@@ -176,7 +176,7 @@ struct mg_callbacks {
      };
      };
      struct mg_context *ctx = mg_start(&my_func, NULL, options);
      struct mg_context *ctx = mg_start(&my_func, NULL, options);
 
 
-   Refer to https://github.com/sunsetbrew/civetweb/blob/master/docs/UserManual.md
+   Refer to https://github.com/bel2125/civetweb/blob/master/docs/UserManual.md
    for the list of valid option and their possible values.
    for the list of valid option and their possible values.
 
 
    Return:
    Return:

+ 2 - 2
resources/civetweb.conf

@@ -1,6 +1,6 @@
 # Civetweb web server configuration file.
 # Civetweb web server configuration file.
 # For detailed description of every option, visit
 # For detailed description of every option, visit
-# https://github.com/sunsetbrew/civetweb/blob/master/docs/UserManual.md
+# https://github.com/bel2125/civetweb/blob/master/docs/UserManual.md
 # Lines starting with '#' and empty lines are ignored.
 # Lines starting with '#' and empty lines are ignored.
 # To make a change, remove leading '#', modify option's value,
 # To make a change, remove leading '#', modify option's value,
 # save this file and then restart Civetweb.
 # save this file and then restart Civetweb.
@@ -29,4 +29,4 @@ listening_ports 8080
 # run_as_user 
 # run_as_user 
 # url_rewrite_patterns 
 # url_rewrite_patterns 
 # hide_files_patterns 
 # hide_files_patterns 
-# request_timeout_ms 30000
+# request_timeout_ms 30000

+ 3 - 3
resources/itworks.html

@@ -12,10 +12,10 @@
 <b style="font-size:larger"><a style="text-decoration:none" href="https://sourceforge.net/projects/civetweb/">Civetweb</a></b><br>
 <b style="font-size:larger"><a style="text-decoration:none" href="https://sourceforge.net/projects/civetweb/">Civetweb</a></b><br>
 <i>Your web server</i>
 <i>Your web server</i>
 <ul>
 <ul>
-<li><a href="https://github.com/sunsetbrew/civetweb/blob/master/docs/UserManual.md">User Manual</a></li>
-<li><a href="https://github.com/sunsetbrew/civetweb/blob/master/RELEASE_NOTES.md">Release Notes</a></li>
+<li><a href="https://github.com/bel2125/civetweb/blob/master/docs/UserManual.md">User Manual</a></li>
+<li><a href="https://github.com/bel2125/civetweb/blob/master/RELEASE_NOTES.md">Release Notes</a></li>
 <li><a href="https://sourceforge.net/projects/civetweb/">Downloads</a></li>
 <li><a href="https://sourceforge.net/projects/civetweb/">Downloads</a></li>
-<li><a href="https://github.com/sunsetbrew/civetweb">GitHub</a></li>
+<li><a href="https://github.com/bel2125/civetweb">GitHub</a></li>
 </ul>
 </ul>
 </p>
 </p>
 </div>
 </div>

+ 4 - 1
src/civetweb.c

@@ -3230,9 +3230,12 @@ static int read_auth_file(struct file *filep, struct read_auth_file_struct * wor
 /* Authorize against the opened passwords file. Return 1 if authorized. */
 /* Authorize against the opened passwords file. Return 1 if authorized. */
 static int authorize(struct mg_connection *conn, struct file *filep)
 static int authorize(struct mg_connection *conn, struct file *filep)
 {
 {
-    struct read_auth_file_struct workdata = {conn};
+    struct read_auth_file_struct workdata;
     char buf[MG_BUF_LEN];
     char buf[MG_BUF_LEN];
 
 
+    memset(&workdata,0,sizeof(workdata));
+    workdata.conn = conn;
+
     if (!parse_auth_header(conn, buf, sizeof(buf), &workdata.ah)) {
     if (!parse_auth_header(conn, buf, sizeof(buf), &workdata.ah)) {
         return 0;
         return 0;
     }
     }

+ 3 - 1
src/main.c

@@ -348,8 +348,10 @@ static void read_config_file(const char *config_file, char **options)
 static void process_command_line_arguments(char *argv[], char **options)
 static void process_command_line_arguments(char *argv[], char **options)
 {
 {
     char *p;
     char *p;
-    FILE *fp = NULL;
     size_t i, cmd_line_opts_start = 1;
     size_t i, cmd_line_opts_start = 1;
+#ifdef CONFIG_FILE2
+    FILE *fp = NULL;
+#endif
 
 
     /* Should we use a config file ? */
     /* Should we use a config file ? */
     if (argv[1] != NULL && argv[1][0] != '-') {
     if (argv[1] != NULL && argv[1][0] != '-') {