summaryrefslogtreecommitdiffstats
path: root/third_party/mongoose
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-26 11:57:23 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-26 11:57:23 +0000
commit85a11f5b1769e02b076f454b28bf2423efe50642 (patch)
tree50d673fa19bc96aa449dbcdc52b6fbcffe0f1b3a /third_party/mongoose
parent5d4c6733c7d7ae58550bb946b94aad764a4afee5 (diff)
downloadchromium_src-85a11f5b1769e02b076f454b28bf2423efe50642.zip
chromium_src-85a11f5b1769e02b076f454b28bf2423efe50642.tar.gz
chromium_src-85a11f5b1769e02b076f454b28bf2423efe50642.tar.bz2
Fix mongoose build for gcc 4.6.
BUG=none Review URL: http://codereview.chromium.org/9235033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/mongoose')
-rw-r--r--third_party/mongoose/README.chromium3
-rw-r--r--third_party/mongoose/chrome-mongoose-modifications.diff38
-rw-r--r--third_party/mongoose/mongoose.c4
3 files changed, 32 insertions, 13 deletions
diff --git a/third_party/mongoose/README.chromium b/third_party/mongoose/README.chromium
index afadc70..97e264a 100644
--- a/third_party/mongoose/README.chromium
+++ b/third_party/mongoose/README.chromium
@@ -15,7 +15,7 @@ bindings to multiple languages. The server is only used to serve custom
URLs from the JSON over HTTP webdriver protocol.
Note: There is no make file for this project, it's compiled directly in
-the chrome versoin of webdriver found under the directory:
+the chrome version of webdriver found under the directory:
src/chrome/test/webdriver
Local modifications (all detailed in chrome-mongoose-modifications.diff,
@@ -24,3 +24,4 @@ pending upstreaming by danielwh):
* Fixed linger code to apply to sockets from bind, rather than shutdown
* Don't ignore SIGCHLD, since the proxy launcher depends on it for determining
chrome's exit code.
+* Removed a "set but never used" variable, to fix build for gcc 4.6.
diff --git a/third_party/mongoose/chrome-mongoose-modifications.diff b/third_party/mongoose/chrome-mongoose-modifications.diff
index f28be1f..0f80a8b 100644
--- a/third_party/mongoose/chrome-mongoose-modifications.diff
+++ b/third_party/mongoose/chrome-mongoose-modifications.diff
@@ -9,11 +9,11 @@ diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c
#define __STDC_FORMAT_MACROS // <inttypes.h> wants this for C++
+#endif // __STDC_FORMAT_MACROS
#endif
-
+
#if defined(__SYMBIAN32__)
@@ -51,8 +53,12 @@
#include <stdio.h>
-
+
#if defined(_WIN32) && !defined(__SYMBIAN32__) // Windows specific
+ #ifdef _WIN32_WINNT
+ #undef _WIN32_WINNT
@@ -21,7 +21,7 @@ diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c
#define _WIN32_WINNT 0x0400 // To make it link in VS2005
#include <windows.h>
+#include <winsock2.h>
-
+
#ifndef PATH_MAX
#define PATH_MAX MAX_PATH
@@ -63,7 +69,6 @@
@@ -30,11 +30,11 @@ diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c
#else // _WIN32_WCE
-#include <winsock2.h>
#define NO_CGI // WinCE has no pipes
-
+
typedef long off_t;
@@ -849,7 +854,9 @@ static int pthread_cond_init(pthread_cond_t *cv, const void *unused) {
}
-
+
static int pthread_cond_wait(pthread_cond_t *cv, pthread_mutex_t *mutex) {
- HANDLE handles[] = {cv->signal, cv->broadcast};
+ HANDLE handles[2];
@@ -46,7 +46,7 @@ diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c
@@ -3424,6 +3431,10 @@ static int set_ports_option(struct mg_context *ctx) {
struct vec vec;
struct socket so, *listener;
-
+
+ struct linger linger;
+ linger.l_onoff = 1;
+ linger.l_linger = 1;
@@ -64,12 +64,12 @@ diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c
listen(sock, 100) != 0) {
closesocket(sock);
@@ -3768,15 +3781,8 @@ static void reset_per_request_attributes(struct mg_connection *conn) {
-
+
static void close_socket_gracefully(SOCKET sock) {
char buf[BUFSIZ];
- struct linger linger;
int n;
-
+
- // Set linger option to avoid socket hanging out after close. This prevent
- // ephemeral port exhaust problem under high QPS.
- linger.l_onoff = 1;
@@ -86,5 +86,25 @@ diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c
- // Also ignoring SIGCHLD to let the OS to reap zombies properly.
- (void) signal(SIGCHLD, SIG_IGN);
#endif // !_WIN32
-
+
(void) pthread_mutex_init(&ctx->mutex, NULL);
+@@ -3812,1 +3812,1 @@ static void close_connection(struct mg_connection *conn) {
+ }
+
+ static void discard_current_request_from_buffer(struct mg_connection *conn) {
+- char *buffered;
+ int buffered_len, body_len;
+
+- buffered = conn->buf + conn->request_len;
+ buffered_len = conn->data_len - conn->request_len;
+ assert(buffered_len >= 0);
+
+@@ -3867,7 +3865,7 @@ static void handle_proxy_request(struct mg_connection *conn) {
+ }
+ conn->peer->client.is_ssl = is_ssl;
+ }
+-
++
+ // Forward client's request to the target
+ mg_printf(conn->peer, "%s %s HTTP/%s\r\n", ri->request_method, ri->uri + len,
+ ri->http_version);
diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c
index 9c9f554..bdf70618 100644
--- a/third_party/mongoose/mongoose.c
+++ b/third_party/mongoose/mongoose.c
@@ -3812,10 +3812,8 @@ static void close_connection(struct mg_connection *conn) {
}
static void discard_current_request_from_buffer(struct mg_connection *conn) {
- char *buffered;
int buffered_len, body_len;
- buffered = conn->buf + conn->request_len;
buffered_len = conn->data_len - conn->request_len;
assert(buffered_len >= 0);
@@ -3867,7 +3865,7 @@ static void handle_proxy_request(struct mg_connection *conn) {
}
conn->peer->client.is_ssl = is_ssl;
}
-
+
// Forward client's request to the target
mg_printf(conn->peer, "%s %s HTTP/%s\r\n", ri->request_method, ri->uri + len,
ri->http_version);