annotate Resources/Patches/mongoose-3.1-patch.diff @ 3349:ef18ea68a362

merge
author Alain Mazy <alain@mazy.be>
date Thu, 18 Apr 2019 15:52:56 +0200
parents 325772dadcd6
children 4a8e8a96b233
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
371
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
1 --- /home/jodogne/Subversion/Orthanc/ThirdPartyDownloads/mongoose/mongoose.c 2012-03-11 23:41:35.000000000 +0100
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
2 +++ mongoose.c 2013-03-07 10:07:00.566266153 +0100
76
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
3 @@ -92,8 +92,9 @@
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
4 #define strtoll(x, y, z) strtol(x, y, z)
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
5 #else
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
6 #define __func__ __FUNCTION__
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
7 -#define strtoull(x, y, z) _strtoui64(x, y, z)
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
8 -#define strtoll(x, y, z) _strtoi64(x, y, z)
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
9 +#include <stdlib.h>
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
10 +//#define strtoull(x, y, z) _strtoui64(x, y, z)
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
11 +//#define strtoll(x, y, z) _strtoi64(x, y, z)
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
12 #endif // _MSC_VER
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
13
e2d68529605f patch for mingw
jodogne
parents: 0
diff changeset
14 #define ERRNO GetLastError()
371
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
15 @@ -253,6 +254,14 @@
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
16 #define MSG_NOSIGNAL 0
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
17 #endif
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
18
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
19 +#if __gnu_hurd__ == 1
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
20 +/**
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
21 + * There is no limit on the length on a path under GNU Hurd, so we set
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
22 + * it to an arbitrary constant.
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
23 + **/
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
24 +#define PATH_MAX 4096
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
25 +#endif
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
26 +
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
27 typedef void * (*mg_thread_func_t)(void *);
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
28
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
29 static const char *http_500_error = "Internal Server Error";
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
30 @@ -3844,10 +3853,8 @@
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 static void discard_current_request_from_buffer(struct mg_connection *conn) {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 - char *buffered;
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 int buffered_len, body_len;
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 - buffered = conn->buf + conn->request_len;
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 buffered_len = conn->data_len - conn->request_len;
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 assert(buffered_len >= 0);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
371
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
41 @@ -4148,7 +4155,13 @@
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 // Wait until mg_fini() stops
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 while (ctx->stop_flag != 2) {
1976
325772dadcd6 Macro "__linux" (now obsolete) replaced by macro "__linux__"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1110
diff changeset
45 +#if defined(__linux__)
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 + usleep(100000);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 +#elif defined(_WIN32)
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 + Sleep(100);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 +#else
371
0ef82ea18da0 fix attempts for Debian/Hurd and Debian/kFreeBSD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 102
diff changeset
50 (void) sleep(0);
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 +#endif
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 free_context(ctx);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54