comparison Resources/Patches/mongoose-patch.diff @ 371:0ef82ea18da0

fix attempts for Debian/Hurd and Debian/kFreeBSD
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 Mar 2013 10:10:02 +0100
parents 7593b57dc1bf
children
comparison
equal deleted inserted replaced
369:4632a044746e 371:0ef82ea18da0
1 --- i/mongoose/mongoose.c 2012-03-11 23:41:35.000000000 +0100 1 --- /home/jodogne/Subversion/Orthanc/ThirdPartyDownloads/mongoose/mongoose.c 2012-03-11 23:41:35.000000000 +0100
2 +++ mongoose.c 2012-09-17 17:32:01.000000000 +0200 2 +++ mongoose.c 2013-03-07 10:07:00.566266153 +0100
3 @@ -92,8 +92,9 @@ 3 @@ -92,8 +92,9 @@
4 #define strtoll(x, y, z) strtol(x, y, z) 4 #define strtoll(x, y, z) strtol(x, y, z)
5 #else 5 #else
6 #define __func__ __FUNCTION__ 6 #define __func__ __FUNCTION__
7 -#define strtoull(x, y, z) _strtoui64(x, y, z) 7 -#define strtoull(x, y, z) _strtoui64(x, y, z)
10 +//#define strtoull(x, y, z) _strtoui64(x, y, z) 10 +//#define strtoull(x, y, z) _strtoui64(x, y, z)
11 +//#define strtoll(x, y, z) _strtoi64(x, y, z) 11 +//#define strtoll(x, y, z) _strtoi64(x, y, z)
12 #endif // _MSC_VER 12 #endif // _MSC_VER
13 13
14 #define ERRNO GetLastError() 14 #define ERRNO GetLastError()
15 @@ -3844,10 +3845,8 @@ 15 @@ -253,6 +254,14 @@
16 #define MSG_NOSIGNAL 0
17 #endif
18
19 +#if __gnu_hurd__ == 1
20 +/**
21 + * There is no limit on the length on a path under GNU Hurd, so we set
22 + * it to an arbitrary constant.
23 + **/
24 +#define PATH_MAX 4096
25 +#endif
26 +
27 typedef void * (*mg_thread_func_t)(void *);
28
29 static const char *http_500_error = "Internal Server Error";
30 @@ -3844,10 +3853,8 @@
16 } 31 }
17 32
18 static void discard_current_request_from_buffer(struct mg_connection *conn) { 33 static void discard_current_request_from_buffer(struct mg_connection *conn) {
19 - char *buffered; 34 - char *buffered;
20 int buffered_len, body_len; 35 int buffered_len, body_len;
21 36
22 - buffered = conn->buf + conn->request_len; 37 - buffered = conn->buf + conn->request_len;
23 buffered_len = conn->data_len - conn->request_len; 38 buffered_len = conn->data_len - conn->request_len;
24 assert(buffered_len >= 0); 39 assert(buffered_len >= 0);
25 40
26 @@ -4148,7 +4147,13 @@ 41 @@ -4148,7 +4155,13 @@
27 42
28 // Wait until mg_fini() stops 43 // Wait until mg_fini() stops
29 while (ctx->stop_flag != 2) { 44 while (ctx->stop_flag != 2) {
30 - (void) sleep(0);
31 +#if defined(__linux) 45 +#if defined(__linux)
32 + usleep(100000); 46 + usleep(100000);
33 +#elif defined(_WIN32) 47 +#elif defined(_WIN32)
34 + Sleep(100); 48 + Sleep(100);
35 +#else 49 +#else
36 +#error Support your platform here 50 (void) sleep(0);
37 +#endif 51 +#endif
38 } 52 }
39 free_context(ctx); 53 free_context(ctx);
40 54