From 1461951d13b063723606f46c6f617b505377899c Mon Sep 17 00:00:00 2001 From: Thomas Davis Date: Thu, 26 Jun 2014 17:38:05 -0400 Subject: [PATCH] Compile fixes for OSX Also fixed github URL's to point to correct project. --- RELEASE_NOTES.md | 2 +- contrib/buildroot/civetweb.mk | 2 +- distribution/arch/PKGBUILD.git.example | 2 +- docs/Building.md | 6 +++--- docs/Embedding.md | 4 ++-- docs/Installing.md | 4 ++-- examples/upload/upload.c | 2 +- examples/ws_server/ws_server.c | 2 +- include/civetweb.h | 4 ++-- resources/civetweb.conf | 4 ++-- resources/itworks.html | 6 +++--- src/civetweb.c | 5 ++++- src/main.c | 4 +++- 13 files changed, 26 insertions(+), 21 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d5bbe09d..307bc9bf 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -190,6 +190,6 @@ Changes - Renamed Mongoose to Civetweb in the code and documentation. - 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/ - Basic build testing diff --git a/contrib/buildroot/civetweb.mk b/contrib/buildroot/civetweb.mk index 17a0e721..9a3120d4 100644 --- a/contrib/buildroot/civetweb.mk +++ b/contrib/buildroot/civetweb.mk @@ -5,7 +5,7 @@ ################################################################################ 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_FILES = LICENSE.md diff --git a/distribution/arch/PKGBUILD.git.example b/distribution/arch/PKGBUILD.git.example index 2c48c8df..5326ca9c 100644 --- a/distribution/arch/PKGBUILD.git.example +++ b/distribution/arch/PKGBUILD.git.example @@ -15,7 +15,7 @@ optdepends=('php-cgi: for php support') provides=("$_pkgname") conflicts=("$_pkgname") 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') pkgver() { diff --git a/docs/Building.md b/docs/Building.md index 60f59f45..38643ae1 100644 --- a/docs/Building.md +++ b/docs/Building.md @@ -2,10 +2,10 @@ Building Civetweb ========= 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? -https://github.com/sunsetbrew/civetweb +https://github.com/bel2125/civetweb Building for Windows @@ -13,7 +13,7 @@ Building for Windows Open the *VS2012/civetweb.sln* in Visual Studio. 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 diff --git a/docs/Embedding.md b/docs/Embedding.md index 8b862e14..ea242adb 100644 --- a/docs/Embedding.md +++ b/docs/Embedding.md @@ -7,7 +7,7 @@ Files ------ 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 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 `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, master thread can accept and queue up to 20 more TCP connections, filling up the queue. diff --git a/docs/Installing.md b/docs/Installing.md index 49e37cef..f1ab27c7 100644 --- a/docs/Installing.md +++ b/docs/Installing.md @@ -1,14 +1,14 @@ 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 --- 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. -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) 2. Download latest *civetweb-win.zip* from [SourceForge](https://sourceforge.net/projects/civetweb/files/) diff --git a/examples/upload/upload.c b/examples/upload/upload.c index 49a3cd06..e4cb3538 100644 --- a/examples/upload/upload.c +++ b/examples/upload/upload.c @@ -1,5 +1,5 @@ // 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 #include diff --git a/examples/ws_server/ws_server.c b/examples/ws_server/ws_server.c index f9aa37ac..575a26a6 100644 --- a/examples/ws_server/ws_server.c +++ b/examples/ws_server/ws_server.c @@ -1,5 +1,5 @@ // 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 diff --git a/include/civetweb.h b/include/civetweb.h index 31d15b8c..1826b9fc 100644 --- a/include/civetweb.h +++ b/include/civetweb.h @@ -77,7 +77,7 @@ struct mg_request_info { /* This structure needs to be passed to mg_start(), to let civetweb know 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 { /* Called when civetweb has received new HTTP request. If callback returns non-zero, @@ -176,7 +176,7 @@ struct mg_callbacks { }; 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. Return: diff --git a/resources/civetweb.conf b/resources/civetweb.conf index 79d47d1e..a7e9461d 100644 --- a/resources/civetweb.conf +++ b/resources/civetweb.conf @@ -1,6 +1,6 @@ # Civetweb web server configuration file. # 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. # To make a change, remove leading '#', modify option's value, # save this file and then restart Civetweb. @@ -29,4 +29,4 @@ listening_ports 8080 # run_as_user # url_rewrite_patterns # hide_files_patterns -# request_timeout_ms 30000 \ No newline at end of file +# request_timeout_ms 30000 diff --git a/resources/itworks.html b/resources/itworks.html index 60db6c5c..cda512de 100644 --- a/resources/itworks.html +++ b/resources/itworks.html @@ -12,10 +12,10 @@ Civetweb
Your web server

diff --git a/src/civetweb.c b/src/civetweb.c index b93ea76c..a3b8cd09 100644 --- a/src/civetweb.c +++ b/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. */ 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]; + memset(&workdata,0,sizeof(workdata)); + workdata.conn = conn; + if (!parse_auth_header(conn, buf, sizeof(buf), &workdata.ah)) { return 0; } diff --git a/src/main.c b/src/main.c index 1a1dfe06..d29ee755 100644 --- a/src/main.c +++ b/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) { char *p; - FILE *fp = NULL; size_t i, cmd_line_opts_start = 1; +#ifdef CONFIG_FILE2 + FILE *fp = NULL; +#endif /* Should we use a config file ? */ if (argv[1] != NULL && argv[1][0] != '-') {