diff options
57 files changed, 183 insertions, 136 deletions
@@ -1,3 +1,17 @@ | |||
1 | Thu Feb 5 22:43:45 MST 2009 | ||
2 | Incompatible API change to allow 64-bit uploads and downloads. | ||
3 | Clients must use "uint64_t" for the "pos" | ||
4 | argument (MHD_ContentReaderCallback) and the "off" | ||
5 | argument (MHD_PostDataIterator) and the "size" | ||
6 | argument (MHD_create_response_from_callback) now. | ||
7 | Also, "unsigned int" was changed to "size_t" for | ||
8 | the "upload_data_size" argument (MHD_AccessHandlerCallback), | ||
9 | the argument to MHD_OPTION_CONNECTION_MEMORY_LIMIT, | ||
10 | the "block_size" argument (MHD_create_response_from_callback), | ||
11 | the "buffer_size" argument (MHD_create_post_processor) and | ||
12 | the "post_data_len" argument (MHD_post_process). You may | ||
13 | need to #include <stdint.h> before <microhttpd.h> from now on. -CG | ||
14 | |||
1 | Thu Feb 5 20:21:08 MST 2009 | 15 | Thu Feb 5 20:21:08 MST 2009 |
2 | Allow getting address information about the connecting | 16 | Allow getting address information about the connecting |
3 | client after the accept call. -CG | 17 | client after the accept call. -CG |
diff --git a/configure.ac b/configure.ac index 1712a724..b02d40d1 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -27,8 +27,8 @@ AM_CONFIG_HEADER([MHD_config.h]) | |||
27 | 27 | ||
28 | AH_TOP([#define _GNU_SOURCE 1]) | 28 | AH_TOP([#define _GNU_SOURCE 1]) |
29 | 29 | ||
30 | LIB_VERSION_CURRENT=4 | 30 | LIB_VERSION_CURRENT=5 |
31 | LIB_VERSION_REVISION=3 | 31 | LIB_VERSION_REVISION=0 |
32 | LIB_VERSION_AGE=0 | 32 | LIB_VERSION_AGE=0 |
33 | AC_SUBST(LIB_VERSION_CURRENT) | 33 | AC_SUBST(LIB_VERSION_CURRENT) |
34 | AC_SUBST(LIB_VERSION_REVISION) | 34 | AC_SUBST(LIB_VERSION_REVISION) |
diff --git a/doc/chapters/basicauthentication.inc b/doc/chapters/basicauthentication.inc index 6b7dcdc6..fc2e45ca 100644 --- a/doc/chapters/basicauthentication.inc +++ b/doc/chapters/basicauthentication.inc | |||
@@ -44,7 +44,7 @@ Not even the headers will be looked at on the first iteration. | |||
44 | @verbatim | 44 | @verbatim |
45 | int answer_to_connection (void *cls, struct MHD_Connection *connection, | 45 | int answer_to_connection (void *cls, struct MHD_Connection *connection, |
46 | const char *url, const char *method, const char *version, | 46 | const char *url, const char *method, const char *version, |
47 | const char *upload_data, unsigned int *upload_data_size, | 47 | const char *upload_data, size_t *upload_data_size, |
48 | void **con_cls) | 48 | void **con_cls) |
49 | { | 49 | { |
50 | if (0 != strcmp(method, "GET")) return MHD_NO; | 50 | if (0 != strcmp(method, "GET")) return MHD_NO; |
diff --git a/doc/chapters/exploringrequests.inc b/doc/chapters/exploringrequests.inc index 11a169dd..d8790025 100644 --- a/doc/chapters/exploringrequests.inc +++ b/doc/chapters/exploringrequests.inc | |||
@@ -11,7 +11,7 @@ without much ado by the server. | |||
11 | @verbatim | 11 | @verbatim |
12 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, | 12 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, |
13 | const char *method, const char *version, const char *upload_data, | 13 | const char *method, const char *version, const char *upload_data, |
14 | unsigned int *upload_data_size, void **con_cls) | 14 | size_t *upload_data_size, void **con_cls) |
15 | { | 15 | { |
16 | ... | 16 | ... |
17 | return MHD_NO; | 17 | return MHD_NO; |
diff --git a/doc/chapters/hellobrowser.inc b/doc/chapters/hellobrowser.inc index 611463e2..444fcd8e 100644 --- a/doc/chapters/hellobrowser.inc +++ b/doc/chapters/hellobrowser.inc | |||
@@ -37,7 +37,7 @@ Talking about the reply, it is defined as a string right after the function head | |||
37 | @verbatim | 37 | @verbatim |
38 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, | 38 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, |
39 | const char *method, const char *version, const char *upload_data, | 39 | const char *method, const char *version, const char *upload_data, |
40 | unsigned int *upload_data_size, void **con_cls) | 40 | size_t *upload_data_size, void **con_cls) |
41 | { | 41 | { |
42 | const char *page = "<html><body>Hello, browser!</body></html>"; | 42 | const char *page = "<html><body>Hello, browser!</body></html>"; |
43 | @end verbatim | 43 | @end verbatim |
diff --git a/doc/chapters/largerpost.inc b/doc/chapters/largerpost.inc index d05dd46d..f1f0e060 100644 --- a/doc/chapters/largerpost.inc +++ b/doc/chapters/largerpost.inc | |||
@@ -86,7 +86,7 @@ a postprocessor has been created and the post iterator is called at least once. | |||
86 | @verbatim | 86 | @verbatim |
87 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, | 87 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, |
88 | const char *method, const char *version, const char *upload_data, | 88 | const char *method, const char *version, const char *upload_data, |
89 | unsigned int *upload_data_size, void **con_cls) | 89 | size_t *upload_data_size, void **con_cls) |
90 | { | 90 | { |
91 | if (NULL == *con_cls) | 91 | if (NULL == *con_cls) |
92 | { | 92 | { |
@@ -195,7 +195,7 @@ the posted data has to be written to the correct file. That is why we store a fi | |||
195 | @verbatim | 195 | @verbatim |
196 | int iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, | 196 | int iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, |
197 | const char *filename, const char *content_type, | 197 | const char *filename, const char *content_type, |
198 | const char *transfer_encoding, const char *data, size_t off, size_t size) | 198 | const char *transfer_encoding, const char *data, uint64_t off, size_t size) |
199 | { | 199 | { |
200 | struct connection_info_struct *con_info = (struct connection_info_struct*) coninfo_cls; | 200 | struct connection_info_struct *con_info = (struct connection_info_struct*) coninfo_cls; |
201 | @end verbatim | 201 | @end verbatim |
diff --git a/doc/chapters/processingpost.inc b/doc/chapters/processingpost.inc index 0677c7e8..f1085ce8 100644 --- a/doc/chapters/processingpost.inc +++ b/doc/chapters/processingpost.inc | |||
@@ -75,7 +75,7 @@ came in. But in this example, the name is assumed to fit entirely inside one sin | |||
75 | @verbatim | 75 | @verbatim |
76 | int iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, | 76 | int iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, |
77 | const char *filename, const char *content_type, | 77 | const char *filename, const char *content_type, |
78 | const char *transfer_encoding, const char *data, size_t off, size_t size) | 78 | const char *transfer_encoding, const char *data, uint64_t off, size_t size) |
79 | { | 79 | { |
80 | struct connection_info_struct *con_info = (struct connection_info_struct*) coninfo_cls; | 80 | struct connection_info_struct *con_info = (struct connection_info_struct*) coninfo_cls; |
81 | 81 | ||
@@ -150,7 +150,7 @@ iterations and other functions. | |||
150 | @verbatim | 150 | @verbatim |
151 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, | 151 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, |
152 | const char *method, const char *version, const char *upload_data, | 152 | const char *method, const char *version, const char *upload_data, |
153 | unsigned int *upload_data_size, void **con_cls) | 153 | size_t *upload_data_size, void **con_cls) |
154 | { | 154 | { |
155 | if(NULL == *con_cls) | 155 | if(NULL == *con_cls) |
156 | { | 156 | { |
diff --git a/doc/chapters/responseheaders.inc b/doc/chapters/responseheaders.inc index 19d10142..3fb9ac15 100644 --- a/doc/chapters/responseheaders.inc +++ b/doc/chapters/responseheaders.inc | |||
@@ -25,7 +25,7 @@ Once again, we can base the new example on the @code{hellobrowser} program. | |||
25 | 25 | ||
26 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, | 26 | int answer_to_connection (void *cls, struct MHD_Connection *connection, const char *url, |
27 | const char *method, const char *version, const char *upload_data, | 27 | const char *method, const char *version, const char *upload_data, |
28 | unsigned int *upload_data_size, void **con_cls) | 28 | size_t *upload_data_size, void **con_cls) |
29 | { | 29 | { |
30 | unsigned char *buffer = NULL; | 30 | unsigned char *buffer = NULL; |
31 | struct MHD_Response *response; | 31 | struct MHD_Response *response; |
diff --git a/doc/examples/basicauthentication.c b/doc/examples/basicauthentication.c index f8c80a35..389d8bb7 100644 --- a/doc/examples/basicauthentication.c +++ b/doc/examples/basicauthentication.c | |||
@@ -109,7 +109,7 @@ int | |||
109 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 109 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
110 | const char *url, const char *method, | 110 | const char *url, const char *method, |
111 | const char *version, const char *upload_data, | 111 | const char *version, const char *upload_data, |
112 | unsigned int *upload_data_size, void **con_cls) | 112 | size_t *upload_data_size, void **con_cls) |
113 | { | 113 | { |
114 | if (0 != strcmp (method, "GET")) | 114 | if (0 != strcmp (method, "GET")) |
115 | return MHD_NO; | 115 | return MHD_NO; |
diff --git a/doc/examples/hellobrowser.c b/doc/examples/hellobrowser.c index 63b8d310..0f2a6762 100644 --- a/doc/examples/hellobrowser.c +++ b/doc/examples/hellobrowser.c | |||
@@ -7,7 +7,7 @@ int | |||
7 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 7 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
8 | const char *url, const char *method, | 8 | const char *url, const char *method, |
9 | const char *version, const char *upload_data, | 9 | const char *version, const char *upload_data, |
10 | unsigned int *upload_data_size, void **con_cls) | 10 | size_t *upload_data_size, void **con_cls) |
11 | { | 11 | { |
12 | const char *page = "<html><body>Hello, browser!</body></html>"; | 12 | const char *page = "<html><body>Hello, browser!</body></html>"; |
13 | struct MHD_Response *response; | 13 | struct MHD_Response *response; |
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c index 7a9c1ef1..aadb3306 100644 --- a/doc/examples/largepost.c +++ b/doc/examples/largepost.c | |||
@@ -65,7 +65,7 @@ send_page (struct MHD_Connection *connection, const char *page, | |||
65 | int | 65 | int |
66 | iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, | 66 | iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, |
67 | const char *filename, const char *content_type, | 67 | const char *filename, const char *content_type, |
68 | const char *transfer_encoding, const char *data, size_t off, | 68 | const char *transfer_encoding, const char *data, uint64_t off, |
69 | size_t size) | 69 | size_t size) |
70 | { | 70 | { |
71 | FILE *fp; | 71 | FILE *fp; |
@@ -136,7 +136,7 @@ int | |||
136 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 136 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
137 | const char *url, const char *method, | 137 | const char *url, const char *method, |
138 | const char *version, const char *upload_data, | 138 | const char *version, const char *upload_data, |
139 | unsigned int *upload_data_size, void **con_cls) | 139 | size_t *upload_data_size, void **con_cls) |
140 | { | 140 | { |
141 | if (NULL == *con_cls) | 141 | if (NULL == *con_cls) |
142 | { | 142 | { |
diff --git a/doc/examples/logging.c b/doc/examples/logging.c index 2daaa4d0..1bb2b054 100644 --- a/doc/examples/logging.c +++ b/doc/examples/logging.c | |||
@@ -16,7 +16,7 @@ int | |||
16 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 16 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
17 | const char *url, const char *method, | 17 | const char *url, const char *method, |
18 | const char *version, const char *upload_data, | 18 | const char *version, const char *upload_data, |
19 | unsigned int *upload_data_size, void **con_cls) | 19 | size_t *upload_data_size, void **con_cls) |
20 | { | 20 | { |
21 | printf ("New request %s for %s using version %s\n", method, url, version); | 21 | printf ("New request %s for %s using version %s\n", method, url, version); |
22 | 22 | ||
diff --git a/doc/examples/responseheaders.c b/doc/examples/responseheaders.c index a94e4433..c83b4480 100644 --- a/doc/examples/responseheaders.c +++ b/doc/examples/responseheaders.c | |||
@@ -33,7 +33,7 @@ int | |||
33 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 33 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
34 | const char *url, const char *method, | 34 | const char *url, const char *method, |
35 | const char *version, const char *upload_data, | 35 | const char *version, const char *upload_data, |
36 | unsigned int *upload_data_size, void **con_cls) | 36 | size_t *upload_data_size, void **con_cls) |
37 | { | 37 | { |
38 | unsigned char *buffer = NULL; | 38 | unsigned char *buffer = NULL; |
39 | struct MHD_Response *response; | 39 | struct MHD_Response *response; |
diff --git a/doc/examples/simplepost.c b/doc/examples/simplepost.c index d8172b87..83c2f3cd 100644 --- a/doc/examples/simplepost.c +++ b/doc/examples/simplepost.c | |||
@@ -53,7 +53,7 @@ send_page (struct MHD_Connection *connection, const char *page) | |||
53 | int | 53 | int |
54 | iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, | 54 | iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, |
55 | const char *filename, const char *content_type, | 55 | const char *filename, const char *content_type, |
56 | const char *transfer_encoding, const char *data, size_t off, | 56 | const char *transfer_encoding, const char *data, uint64_t off, |
57 | size_t size) | 57 | size_t size) |
58 | { | 58 | { |
59 | struct connection_info_struct *con_info = | 59 | struct connection_info_struct *con_info = |
@@ -108,7 +108,7 @@ int | |||
108 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 108 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
109 | const char *url, const char *method, | 109 | const char *url, const char *method, |
110 | const char *version, const char *upload_data, | 110 | const char *version, const char *upload_data, |
111 | unsigned int *upload_data_size, void **con_cls) | 111 | size_t *upload_data_size, void **con_cls) |
112 | { | 112 | { |
113 | if (NULL == *con_cls) | 113 | if (NULL == *con_cls) |
114 | { | 114 | { |
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c index efbc6e06..efb1e37e 100644 --- a/doc/examples/tlsauthentication.c +++ b/doc/examples/tlsauthentication.c | |||
@@ -162,7 +162,7 @@ int | |||
162 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 162 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
163 | const char *url, const char *method, | 163 | const char *url, const char *method, |
164 | const char *version, const char *upload_data, | 164 | const char *version, const char *upload_data, |
165 | unsigned int *upload_data_size, void **con_cls) | 165 | size_t *upload_data_size, void **con_cls) |
166 | { | 166 | { |
167 | if (0 != strcmp (method, "GET")) | 167 | if (0 != strcmp (method, "GET")) |
168 | return MHD_NO; | 168 | return MHD_NO; |
diff --git a/doc/microhttpd.texi b/doc/microhttpd.texi index 65b7682b..fcc714bf 100644 --- a/doc/microhttpd.texi +++ b/doc/microhttpd.texi | |||
@@ -251,7 +251,7 @@ No more options / last option. This is used to terminate the VARARGs | |||
251 | list. | 251 | list. |
252 | 252 | ||
253 | @item MHD_OPTION_CONNECTION_MEMORY_LIMIT | 253 | @item MHD_OPTION_CONNECTION_MEMORY_LIMIT |
254 | Maximum memory size per connection (followed by an @code{unsigned int}). | 254 | Maximum memory size per connection (followed by a @code{size_t}). |
255 | 255 | ||
256 | @item MHD_OPTION_CONNECTION_LIMIT | 256 | @item MHD_OPTION_CONNECTION_LIMIT |
257 | Maximum number of concurrenct connections to accept (followed by an | 257 | Maximum number of concurrenct connections to accept (followed by an |
@@ -551,7 +551,7 @@ length of the address information. | |||
551 | @end deftypefn | 551 | @end deftypefn |
552 | 552 | ||
553 | 553 | ||
554 | @deftypefn {Function Pointer} int {*MHD_AccessHandlerCallback} (void *cls, struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, unsigned int *upload_data_size, void **con_cls) | 554 | @deftypefn {Function Pointer} int {*MHD_AccessHandlerCallback} (void *cls, struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) |
555 | Invoked in the context of a connection to answer a request from the | 555 | Invoked in the context of a connection to answer a request from the |
556 | client. This callback must call @mhd{} functions (example: the | 556 | client. This callback must call @mhd{} functions (example: the |
557 | @code{MHD_Response} ones) to provide content to give back to the client | 557 | @code{MHD_Response} ones) to provide content to give back to the client |
@@ -654,7 +654,7 @@ iteration. | |||
654 | @end deftypefn | 654 | @end deftypefn |
655 | 655 | ||
656 | 656 | ||
657 | @deftypefn {Function Pointer} int {*MHD_ContentReaderCallback} (void *cls, size_t pos, char *buf, int max) | 657 | @deftypefn {Function Pointer} int {*MHD_ContentReaderCallback} (void *cls, uint64_t pos, char *buf, int max) |
658 | Callback used by @mhd{} in order to obtain content. The callback has to | 658 | Callback used by @mhd{} in order to obtain content. The callback has to |
659 | copy at most @var{max} bytes of content into @var{buf}. The total | 659 | copy at most @var{max} bytes of content into @var{buf}. The total |
660 | number of bytes that has been placed into @var{buf} should be returned. | 660 | number of bytes that has been placed into @var{buf} should be returned. |
@@ -691,7 +691,7 @@ It should be used to free resources associated with the content reader. | |||
691 | @end deftypefn | 691 | @end deftypefn |
692 | 692 | ||
693 | 693 | ||
694 | @deftypefn {Function Pointer} int {*MHD_PostDataIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, size_t off, size_t size) | 694 | @deftypefn {Function Pointer} int {*MHD_PostDataIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size) |
695 | Iterator over key-value pairs where the value maybe made available in | 695 | Iterator over key-value pairs where the value maybe made available in |
696 | increments and/or may not be zero-terminated. Used for processing | 696 | increments and/or may not be zero-terminated. Used for processing |
697 | @code{POST} data. | 697 | @code{POST} data. |
@@ -1005,7 +1005,7 @@ the @code{MHD_Response} object is released. | |||
1005 | @section Creating response objects | 1005 | @section Creating response objects |
1006 | 1006 | ||
1007 | 1007 | ||
1008 | @deftypefun {struct MHD_Response *} MHD_create_response_from_callback (size_t size, unsigned int block_size, MHD_ContentReaderCallback crc, void *crc_cls, MHD_ContentReaderFreeCallback crfc) | 1008 | @deftypefun {struct MHD_Response *} MHD_create_response_from_callback (uint64_t size, size_t block_size, MHD_ContentReaderCallback crc, void *crc_cls, MHD_ContentReaderFreeCallback crfc) |
1009 | Create a response object. The response object can be extended with | 1009 | Create a response object. The response object can be extended with |
1010 | header information and then it can be used any number of times. | 1010 | header information and then it can be used any number of times. |
1011 | 1011 | ||
@@ -1167,7 +1167,7 @@ access_handler (void *cls, | |||
1167 | struct MHD_Connection * connection, | 1167 | struct MHD_Connection * connection, |
1168 | const char *url, | 1168 | const char *url, |
1169 | const char *method, const char *version, | 1169 | const char *method, const char *version, |
1170 | const char *upload_data, unsigned int *upload_data_size, | 1170 | const char *upload_data, size_t *upload_data_size, |
1171 | void **con_cls) | 1171 | void **con_cls) |
1172 | @{ | 1172 | @{ |
1173 | static int old_connection_marker; | 1173 | static int old_connection_marker; |
@@ -1195,7 +1195,7 @@ access_handler (void *cls, | |||
1195 | struct MHD_Connection * connection, | 1195 | struct MHD_Connection * connection, |
1196 | const char *url, | 1196 | const char *url, |
1197 | const char *method, const char *version, | 1197 | const char *method, const char *version, |
1198 | const char *upload_data, unsigned int *upload_data_size, | 1198 | const char *upload_data, size_t *upload_data_size, |
1199 | void **con_cls) | 1199 | void **con_cls) |
1200 | @{ | 1200 | @{ |
1201 | struct MHD_PostProcessor * pp = *con_cls; | 1201 | struct MHD_PostProcessor * pp = *con_cls; |
@@ -1234,7 +1234,7 @@ always terminate normally. | |||
1234 | 1234 | ||
1235 | 1235 | ||
1236 | 1236 | ||
1237 | @deftypefun {struct MHD_PostProcessor *} MHD_create_post_processor (struct MHD_Connection *connection, unsigned int buffer_size, MHD_PostDataIterator iterator, void *iterator_cls) | 1237 | @deftypefun {struct MHD_PostProcessor *} MHD_create_post_processor (struct MHD_Connection *connection, size_t buffer_size, MHD_PostDataIterator iterator, void *iterator_cls) |
1238 | Create a PostProcessor. A PostProcessor can be used to (incrementally) | 1238 | Create a PostProcessor. A PostProcessor can be used to (incrementally) |
1239 | parse the data portion of a @code{POST} request. | 1239 | parse the data portion of a @code{POST} request. |
1240 | 1240 | ||
@@ -1261,7 +1261,7 @@ a PP handle. | |||
1261 | @end deftypefun | 1261 | @end deftypefun |
1262 | 1262 | ||
1263 | 1263 | ||
1264 | @deftypefun int MHD_post_process (struct MHD_PostProcessor *pp, const char *post_data, unsigned int post_data_len) | 1264 | @deftypefun int MHD_post_process (struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len) |
1265 | Parse and process @code{POST} data. Call this function when @code{POST} | 1265 | Parse and process @code{POST} data. Call this function when @code{POST} |
1266 | data is available (usually during an @code{MHD_AccessHandlerCallback}) | 1266 | data is available (usually during an @code{MHD_AccessHandlerCallback}) |
1267 | with the @var{upload_data} and @var{upload_data_size}. Whenever | 1267 | with the @var{upload_data} and @var{upload_data_size}. Whenever |
diff --git a/src/daemon/connection.c b/src/daemon/connection.c index b049d1a5..c5dd86c7 100644 --- a/src/daemon/connection.c +++ b/src/daemon/connection.c | |||
@@ -366,7 +366,7 @@ try_ready_chunked_body (struct MHD_Connection *connection) | |||
366 | int ret; | 366 | int ret; |
367 | char *buf; | 367 | char *buf; |
368 | struct MHD_Response *response; | 368 | struct MHD_Response *response; |
369 | unsigned int size; | 369 | size_t size; |
370 | char cbuf[10]; /* 10: max strlen of "%x\r\n" */ | 370 | char cbuf[10]; /* 10: max strlen of "%x\r\n" */ |
371 | int cblen; | 371 | int cblen; |
372 | 372 | ||
@@ -466,7 +466,8 @@ add_extra_headers (struct MHD_Connection *connection) | |||
466 | MHD_HTTP_HEADER_CONTENT_LENGTH)) | 466 | MHD_HTTP_HEADER_CONTENT_LENGTH)) |
467 | { | 467 | { |
468 | SPRINTF (buf, | 468 | SPRINTF (buf, |
469 | "%llu", (unsigned long long) connection->response->total_size); | 469 | "%llu", |
470 | connection->response->total_size); | ||
470 | MHD_add_response_header (connection->response, | 471 | MHD_add_response_header (connection->response, |
471 | MHD_HTTP_HEADER_CONTENT_LENGTH, buf); | 472 | MHD_HTTP_HEADER_CONTENT_LENGTH, buf); |
472 | } | 473 | } |
@@ -1087,11 +1088,11 @@ parse_initial_message_line (struct MHD_Connection *connection, char *line) | |||
1087 | static void | 1088 | static void |
1088 | call_connection_handler (struct MHD_Connection *connection) | 1089 | call_connection_handler (struct MHD_Connection *connection) |
1089 | { | 1090 | { |
1090 | unsigned int processed; | 1091 | size_t processed; |
1091 | unsigned int available; | 1092 | size_t available; |
1092 | unsigned int used; | 1093 | size_t used; |
1094 | size_t i; | ||
1093 | int instant_retry; | 1095 | int instant_retry; |
1094 | unsigned int i; | ||
1095 | int malformed; | 1096 | int malformed; |
1096 | char *buffer_head; | 1097 | char *buffer_head; |
1097 | 1098 | ||
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 50eb96f7..0054dd94 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -861,7 +861,7 @@ MHD_start_daemon_va (unsigned int options, | |||
861 | switch (opt) | 861 | switch (opt) |
862 | { | 862 | { |
863 | case MHD_OPTION_CONNECTION_MEMORY_LIMIT: | 863 | case MHD_OPTION_CONNECTION_MEMORY_LIMIT: |
864 | retVal->pool_size = va_arg (ap, unsigned int); | 864 | retVal->pool_size = va_arg (ap, size_t); |
865 | break; | 865 | break; |
866 | case MHD_OPTION_CONNECTION_LIMIT: | 866 | case MHD_OPTION_CONNECTION_LIMIT: |
867 | retVal->max_connections = va_arg (ap, unsigned int); | 867 | retVal->max_connections = va_arg (ap, unsigned int); |
diff --git a/src/daemon/daemon_test.c b/src/daemon/daemon_test.c index 046d1de0..f48eb9f8 100644 --- a/src/daemon/daemon_test.c +++ b/src/daemon/daemon_test.c | |||
@@ -65,7 +65,7 @@ ahc_nothing (void *cls, | |||
65 | const char *url, | 65 | const char *url, |
66 | const char *method, | 66 | const char *method, |
67 | const char *version, | 67 | const char *version, |
68 | const char *upload_data, unsigned int *upload_data_size, | 68 | const char *upload_data, size_t *upload_data_size, |
69 | void **unused) | 69 | void **unused) |
70 | { | 70 | { |
71 | return MHD_NO; | 71 | return MHD_NO; |
diff --git a/src/daemon/internal.c b/src/daemon/internal.c index fba19551..f30cc09a 100644 --- a/src/daemon/internal.c +++ b/src/daemon/internal.c | |||
@@ -118,7 +118,7 @@ MHD_tls_log_func (int level, const char *str) | |||
118 | /** | 118 | /** |
119 | * Process escape sequences ('+'=space, %HH) | 119 | * Process escape sequences ('+'=space, %HH) |
120 | */ | 120 | */ |
121 | unsigned int | 121 | size_t |
122 | MHD_http_unescape (char *val) | 122 | MHD_http_unescape (char *val) |
123 | { | 123 | { |
124 | char *rpos = val; | 124 | char *rpos = val; |
diff --git a/src/daemon/internal.h b/src/daemon/internal.h index b257de2c..f0a6ae4c 100644 --- a/src/daemon/internal.h +++ b/src/daemon/internal.h | |||
@@ -62,7 +62,7 @@ void MHD_tls_log_func (int level, const char *str); | |||
62 | * @return length of the resulting val (strlen(val) maybe | 62 | * @return length of the resulting val (strlen(val) maybe |
63 | * shorter afterwards due to elimination of escape sequences) | 63 | * shorter afterwards due to elimination of escape sequences) |
64 | */ | 64 | */ |
65 | unsigned int MHD_http_unescape (char *val); | 65 | size_t MHD_http_unescape (char *val); |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * Header or cookie in HTTP request or response. | 68 | * Header or cookie in HTTP request or response. |
@@ -145,7 +145,7 @@ struct MHD_Response | |||
145 | /** | 145 | /** |
146 | * Set to -1 if size is not known. | 146 | * Set to -1 if size is not known. |
147 | */ | 147 | */ |
148 | size_t total_size; | 148 | uint64_t total_size; |
149 | 149 | ||
150 | /** | 150 | /** |
151 | * Size of data. | 151 | * Size of data. |
@@ -161,7 +161,7 @@ struct MHD_Response | |||
161 | * At what offset in the stream is the | 161 | * At what offset in the stream is the |
162 | * beginning of data located? | 162 | * beginning of data located? |
163 | */ | 163 | */ |
164 | size_t data_start; | 164 | uint64_t data_start; |
165 | 165 | ||
166 | }; | 166 | }; |
167 | 167 | ||
@@ -485,14 +485,14 @@ struct MHD_Connection | |||
485 | * How many more bytes of the body do we expect | 485 | * How many more bytes of the body do we expect |
486 | * to read? "-1" for unknown. | 486 | * to read? "-1" for unknown. |
487 | */ | 487 | */ |
488 | size_t remaining_upload_size; | 488 | uint64_t remaining_upload_size; |
489 | 489 | ||
490 | /** | 490 | /** |
491 | * Current write position in the actual response | 491 | * Current write position in the actual response |
492 | * (excluding headers, content only; should be 0 | 492 | * (excluding headers, content only; should be 0 |
493 | * while sending headers). | 493 | * while sending headers). |
494 | */ | 494 | */ |
495 | size_t response_write_position; | 495 | uint64_t response_write_position; |
496 | 496 | ||
497 | /** | 497 | /** |
498 | * Position in the 100 CONTINUE message that | 498 | * Position in the 100 CONTINUE message that |
@@ -699,7 +699,7 @@ struct MHD_Daemon | |||
699 | /** | 699 | /** |
700 | * Size of the per-connection memory pools. | 700 | * Size of the per-connection memory pools. |
701 | */ | 701 | */ |
702 | unsigned int pool_size; | 702 | size_t pool_size; |
703 | 703 | ||
704 | /** | 704 | /** |
705 | * Limit on the number of parallel connections. | 705 | * Limit on the number of parallel connections. |
diff --git a/src/daemon/memorypool.c b/src/daemon/memorypool.c index 2e566fd8..923ad502 100644 --- a/src/daemon/memorypool.c +++ b/src/daemon/memorypool.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | (C) 2007 Daniel Pittman and Christian Grothoff | 3 | (C) 2007, 2009 Daniel Pittman and Christian Grothoff |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
@@ -44,17 +44,17 @@ struct MemoryPool | |||
44 | /** | 44 | /** |
45 | * Size of the pool. | 45 | * Size of the pool. |
46 | */ | 46 | */ |
47 | unsigned int size; | 47 | size_t size; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Offset of the first unallocated byte. | 50 | * Offset of the first unallocated byte. |
51 | */ | 51 | */ |
52 | unsigned int pos; | 52 | size_t pos; |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Offset of the last unallocated byte. | 55 | * Offset of the last unallocated byte. |
56 | */ | 56 | */ |
57 | unsigned int end; | 57 | size_t end; |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * MHD_NO if pool was malloc'ed, MHD_YES if mmapped. | 60 | * MHD_NO if pool was malloc'ed, MHD_YES if mmapped. |
@@ -68,7 +68,7 @@ struct MemoryPool | |||
68 | * @param max maximum size of the pool | 68 | * @param max maximum size of the pool |
69 | */ | 69 | */ |
70 | struct MemoryPool * | 70 | struct MemoryPool * |
71 | MHD_pool_create (unsigned int max) | 71 | MHD_pool_create (size_t max) |
72 | { | 72 | { |
73 | struct MemoryPool *pool; | 73 | struct MemoryPool *pool; |
74 | 74 | ||
@@ -122,7 +122,8 @@ MHD_pool_destroy (struct MemoryPool *pool) | |||
122 | * bytes | 122 | * bytes |
123 | */ | 123 | */ |
124 | void * | 124 | void * |
125 | MHD_pool_allocate (struct MemoryPool *pool, unsigned int size, int from_end) | 125 | MHD_pool_allocate (struct MemoryPool *pool, |
126 | size_t size, int from_end) | ||
126 | { | 127 | { |
127 | void *ret; | 128 | void *ret; |
128 | 129 | ||
@@ -159,7 +160,9 @@ MHD_pool_allocate (struct MemoryPool *pool, unsigned int size, int from_end) | |||
159 | */ | 160 | */ |
160 | void * | 161 | void * |
161 | MHD_pool_reallocate (struct MemoryPool *pool, | 162 | MHD_pool_reallocate (struct MemoryPool *pool, |
162 | void *old, unsigned int old_size, unsigned int new_size) | 163 | void *old, |
164 | size_t old_size, | ||
165 | size_t new_size) | ||
163 | { | 166 | { |
164 | void *ret; | 167 | void *ret; |
165 | 168 | ||
@@ -204,7 +207,9 @@ MHD_pool_reallocate (struct MemoryPool *pool, | |||
204 | * @return addr new address of "keep" (if it had to change) | 207 | * @return addr new address of "keep" (if it had to change) |
205 | */ | 208 | */ |
206 | void * | 209 | void * |
207 | MHD_pool_reset (struct MemoryPool *pool, void *keep, unsigned int size) | 210 | MHD_pool_reset (struct MemoryPool *pool, |
211 | void *keep, | ||
212 | size_t size) | ||
208 | { | 213 | { |
209 | if (keep != NULL) | 214 | if (keep != NULL) |
210 | { | 215 | { |
diff --git a/src/daemon/memorypool.h b/src/daemon/memorypool.h index 537fb61e..51f81674 100644 --- a/src/daemon/memorypool.h +++ b/src/daemon/memorypool.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | (C) 2007 Daniel Pittman and Christian Grothoff | 3 | (C) 2007, 2009 Daniel Pittman and Christian Grothoff |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
@@ -42,7 +42,7 @@ struct MemoryPool; | |||
42 | * | 42 | * |
43 | * @param max maximum size of the pool | 43 | * @param max maximum size of the pool |
44 | */ | 44 | */ |
45 | struct MemoryPool *MHD_pool_create (unsigned int max); | 45 | struct MemoryPool *MHD_pool_create (size_t max); |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * Destroy a memory pool. | 48 | * Destroy a memory pool. |
@@ -59,7 +59,7 @@ void MHD_pool_destroy (struct MemoryPool *pool); | |||
59 | * bytes | 59 | * bytes |
60 | */ | 60 | */ |
61 | void *MHD_pool_allocate (struct MemoryPool *pool, | 61 | void *MHD_pool_allocate (struct MemoryPool *pool, |
62 | unsigned int size, int from_end); | 62 | size_t size, int from_end); |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * Reallocate a block of memory obtained from the pool. | 65 | * Reallocate a block of memory obtained from the pool. |
@@ -79,7 +79,8 @@ void *MHD_pool_allocate (struct MemoryPool *pool, | |||
79 | */ | 79 | */ |
80 | void *MHD_pool_reallocate (struct MemoryPool *pool, | 80 | void *MHD_pool_reallocate (struct MemoryPool *pool, |
81 | void *old, | 81 | void *old, |
82 | unsigned int old_size, unsigned int new_size); | 82 | size_t old_size, |
83 | size_t new_size); | ||
83 | 84 | ||
84 | /** | 85 | /** |
85 | * Clear all entries from the memory pool except | 86 | * Clear all entries from the memory pool except |
@@ -89,6 +90,8 @@ void *MHD_pool_reallocate (struct MemoryPool *pool, | |||
89 | * @param size how many bytes need to be kept at this address | 90 | * @param size how many bytes need to be kept at this address |
90 | * @return addr new address of "keep" (if it had to change) | 91 | * @return addr new address of "keep" (if it had to change) |
91 | */ | 92 | */ |
92 | void *MHD_pool_reset (struct MemoryPool *pool, void *keep, unsigned int size); | 93 | void *MHD_pool_reset (struct MemoryPool *pool, |
94 | void *keep, | ||
95 | size_t size); | ||
93 | 96 | ||
94 | #endif | 97 | #endif |
diff --git a/src/daemon/postprocessor.c b/src/daemon/postprocessor.c index 60f09311..7cc11dde 100644 --- a/src/daemon/postprocessor.c +++ b/src/daemon/postprocessor.c | |||
@@ -172,22 +172,22 @@ struct MHD_PostProcessor | |||
172 | /** | 172 | /** |
173 | * Size of our buffer for the key. | 173 | * Size of our buffer for the key. |
174 | */ | 174 | */ |
175 | unsigned int buffer_size; | 175 | size_t buffer_size; |
176 | 176 | ||
177 | /** | 177 | /** |
178 | * Current position in the key buffer. | 178 | * Current position in the key buffer. |
179 | */ | 179 | */ |
180 | unsigned int buffer_pos; | 180 | size_t buffer_pos; |
181 | 181 | ||
182 | /** | 182 | /** |
183 | * Current position in xbuf. | 183 | * Current position in xbuf. |
184 | */ | 184 | */ |
185 | unsigned int xbuf_pos; | 185 | size_t xbuf_pos; |
186 | 186 | ||
187 | /** | 187 | /** |
188 | * Current offset in the value being processed. | 188 | * Current offset in the value being processed. |
189 | */ | 189 | */ |
190 | unsigned int value_offset; | 190 | uint64_t value_offset; |
191 | 191 | ||
192 | /** | 192 | /** |
193 | * strlen(boundary) -- if boundary != NULL. | 193 | * strlen(boundary) -- if boundary != NULL. |
@@ -247,7 +247,7 @@ struct MHD_PostProcessor | |||
247 | */ | 247 | */ |
248 | struct MHD_PostProcessor * | 248 | struct MHD_PostProcessor * |
249 | MHD_create_post_processor (struct MHD_Connection *connection, | 249 | MHD_create_post_processor (struct MHD_Connection *connection, |
250 | unsigned int buffer_size, | 250 | size_t buffer_size, |
251 | MHD_PostDataIterator ikvi, void *cls) | 251 | MHD_PostDataIterator ikvi, void *cls) |
252 | { | 252 | { |
253 | struct MHD_PostProcessor *ret; | 253 | struct MHD_PostProcessor *ret; |
@@ -304,13 +304,14 @@ MHD_create_post_processor (struct MHD_Connection *connection, | |||
304 | */ | 304 | */ |
305 | static int | 305 | static int |
306 | post_process_urlencoded (struct MHD_PostProcessor *pp, | 306 | post_process_urlencoded (struct MHD_PostProcessor *pp, |
307 | const char *post_data, unsigned int post_data_len) | 307 | const char *post_data, |
308 | size_t post_data_len) | ||
308 | { | 309 | { |
309 | unsigned int equals; | 310 | size_t equals; |
310 | unsigned int amper; | 311 | size_t amper; |
311 | unsigned int poff; | 312 | size_t poff; |
312 | unsigned int xoff; | 313 | size_t xoff; |
313 | unsigned int delta; | 314 | size_t delta; |
314 | int end_of_value_found; | 315 | int end_of_value_found; |
315 | char *buf; | 316 | char *buf; |
316 | char xbuf[XBUF_SIZE + 1]; | 317 | char xbuf[XBUF_SIZE + 1]; |
@@ -472,7 +473,7 @@ static int | |||
472 | find_boundary (struct MHD_PostProcessor *pp, | 473 | find_boundary (struct MHD_PostProcessor *pp, |
473 | const char *boundary, | 474 | const char *boundary, |
474 | size_t blen, | 475 | size_t blen, |
475 | unsigned int *ioffptr, | 476 | size_t *ioffptr, |
476 | enum PP_State next_state, enum PP_State next_dash_state) | 477 | enum PP_State next_state, enum PP_State next_dash_state) |
477 | { | 478 | { |
478 | char *buf = (char *) &pp[1]; | 479 | char *buf = (char *) &pp[1]; |
@@ -554,10 +555,10 @@ try_get_value (const char *buf, const char *key, char **destination) | |||
554 | */ | 555 | */ |
555 | static int | 556 | static int |
556 | process_multipart_headers (struct MHD_PostProcessor *pp, | 557 | process_multipart_headers (struct MHD_PostProcessor *pp, |
557 | unsigned int *ioffptr, enum PP_State next_state) | 558 | size_t *ioffptr, enum PP_State next_state) |
558 | { | 559 | { |
559 | char *buf = (char *) &pp[1]; | 560 | char *buf = (char *) &pp[1]; |
560 | unsigned int newline; | 561 | size_t newline; |
561 | 562 | ||
562 | newline = 0; | 563 | newline = 0; |
563 | while ((newline < pp->buffer_pos) && | 564 | while ((newline < pp->buffer_pos) && |
@@ -615,14 +616,14 @@ process_multipart_headers (struct MHD_PostProcessor *pp, | |||
615 | */ | 616 | */ |
616 | static int | 617 | static int |
617 | process_value_to_boundary (struct MHD_PostProcessor *pp, | 618 | process_value_to_boundary (struct MHD_PostProcessor *pp, |
618 | unsigned int *ioffptr, | 619 | size_t *ioffptr, |
619 | const char *boundary, | 620 | const char *boundary, |
620 | size_t blen, | 621 | size_t blen, |
621 | enum PP_State next_state, | 622 | enum PP_State next_state, |
622 | enum PP_State next_dash_state) | 623 | enum PP_State next_dash_state) |
623 | { | 624 | { |
624 | char *buf = (char *) &pp[1]; | 625 | char *buf = (char *) &pp[1]; |
625 | unsigned int newline; | 626 | size_t newline; |
626 | 627 | ||
627 | /* all data in buf until the boundary | 628 | /* all data in buf until the boundary |
628 | (\r\n--+boundary) is part of the value */ | 629 | (\r\n--+boundary) is part of the value */ |
@@ -716,12 +717,13 @@ free_unmarked (struct MHD_PostProcessor *pp) | |||
716 | */ | 717 | */ |
717 | static int | 718 | static int |
718 | post_process_multipart (struct MHD_PostProcessor *pp, | 719 | post_process_multipart (struct MHD_PostProcessor *pp, |
719 | const char *post_data, unsigned int post_data_len) | 720 | const char *post_data, |
721 | size_t post_data_len) | ||
720 | { | 722 | { |
721 | char *buf; | 723 | char *buf; |
722 | unsigned int max; | 724 | size_t max; |
723 | unsigned int ioff; | 725 | size_t ioff; |
724 | unsigned int poff; | 726 | size_t poff; |
725 | int state_changed; | 727 | int state_changed; |
726 | 728 | ||
727 | buf = (char *) &pp[1]; | 729 | buf = (char *) &pp[1]; |
@@ -999,7 +1001,7 @@ END: | |||
999 | */ | 1001 | */ |
1000 | int | 1002 | int |
1001 | MHD_post_process (struct MHD_PostProcessor *pp, | 1003 | MHD_post_process (struct MHD_PostProcessor *pp, |
1002 | const char *post_data, unsigned int post_data_len) | 1004 | const char *post_data, size_t post_data_len) |
1003 | { | 1005 | { |
1004 | if (post_data_len == 0) | 1006 | if (post_data_len == 0) |
1005 | return MHD_YES; | 1007 | return MHD_YES; |
diff --git a/src/daemon/postprocessor_large_test.c b/src/daemon/postprocessor_large_test.c index 0e8f593c..6bfeffa7 100644 --- a/src/daemon/postprocessor_large_test.c +++ b/src/daemon/postprocessor_large_test.c | |||
@@ -39,12 +39,12 @@ value_checker (void *cls, | |||
39 | const char *filename, | 39 | const char *filename, |
40 | const char *content_type, | 40 | const char *content_type, |
41 | const char *transfer_encoding, | 41 | const char *transfer_encoding, |
42 | const char *data, size_t off, size_t size) | 42 | const char *data, uint64_t off, size_t size) |
43 | { | 43 | { |
44 | unsigned int *pos = cls; | 44 | unsigned int *pos = cls; |
45 | #if 0 | 45 | #if 0 |
46 | fprintf (stderr, | 46 | fprintf (stderr, |
47 | "VC: %u %u `%s' `%s' `%s' `%s' `%.*s'\n", | 47 | "VC: %llu %u `%s' `%s' `%s' `%s' `%.*s'\n", |
48 | off, size, | 48 | off, size, |
49 | key, filename, content_type, transfer_encoding, size, data); | 49 | key, filename, content_type, transfer_encoding, size, data); |
50 | #endif | 50 | #endif |
diff --git a/src/daemon/postprocessor_test.c b/src/daemon/postprocessor_test.c index 6e1c1418..fd63de73 100644 --- a/src/daemon/postprocessor_test.c +++ b/src/daemon/postprocessor_test.c | |||
@@ -79,7 +79,7 @@ value_checker (void *cls, | |||
79 | const char *filename, | 79 | const char *filename, |
80 | const char *content_type, | 80 | const char *content_type, |
81 | const char *transfer_encoding, | 81 | const char *transfer_encoding, |
82 | const char *data, size_t off, size_t size) | 82 | const char *data, uint64_t off, size_t size) |
83 | { | 83 | { |
84 | int *want_off = cls; | 84 | int *want_off = cls; |
85 | int idx = *want_off; | 85 | int idx = *want_off; |
diff --git a/src/daemon/response.c b/src/daemon/response.c index 3089e6c1..8cc985b2 100644 --- a/src/daemon/response.c +++ b/src/daemon/response.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | (C) 2007 Daniel Pittman and Christian Grothoff | 3 | (C) 2007, 2009 Daniel Pittman and Christian Grothoff |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
@@ -175,8 +175,8 @@ MHD_get_response_header (struct MHD_Response *response, const char *key) | |||
175 | * @return NULL on error (i.e. invalid arguments, out of memory) | 175 | * @return NULL on error (i.e. invalid arguments, out of memory) |
176 | */ | 176 | */ |
177 | struct MHD_Response * | 177 | struct MHD_Response * |
178 | MHD_create_response_from_callback (size_t size, | 178 | MHD_create_response_from_callback (uint64_t size, |
179 | unsigned int block_size, | 179 | size_t block_size, |
180 | MHD_ContentReaderCallback crc, | 180 | MHD_ContentReaderCallback crc, |
181 | void *crc_cls, | 181 | void *crc_cls, |
182 | MHD_ContentReaderFreeCallback crfc) | 182 | MHD_ContentReaderFreeCallback crfc) |
diff --git a/src/examples/fileserver_example.c b/src/examples/fileserver_example.c index 4a120fb0..b9eeed57 100644 --- a/src/examples/fileserver_example.c +++ b/src/examples/fileserver_example.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define PAGE "<html><head><title>File not found</title></head><body>File not found</body></html>" | 30 | #define PAGE "<html><head><title>File not found</title></head><body>File not found</body></html>" |
31 | 31 | ||
32 | static int | 32 | static int |
33 | file_reader (void *cls, size_t pos, char *buf, int max) | 33 | file_reader (void *cls, uint64_t pos, char *buf, int max) |
34 | { | 34 | { |
35 | FILE *file = cls; | 35 | FILE *file = cls; |
36 | 36 | ||
diff --git a/src/examples/fileserver_example_external_select.c b/src/examples/fileserver_example_external_select.c index e3762abf..0b3a5a8b 100644 --- a/src/examples/fileserver_example_external_select.c +++ b/src/examples/fileserver_example_external_select.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define PAGE "<html><head><title>File not found</title></head><body>File not found</body></html>" | 30 | #define PAGE "<html><head><title>File not found</title></head><body>File not found</body></html>" |
31 | 31 | ||
32 | static int | 32 | static int |
33 | file_reader (void *cls, size_t pos, char *buf, int max) | 33 | file_reader (void *cls, uint64_t pos, char *buf, int max) |
34 | { | 34 | { |
35 | FILE *file = cls; | 35 | FILE *file = cls; |
36 | 36 | ||
diff --git a/src/examples/https_fileserver_example.c b/src/examples/https_fileserver_example.c index 3244ca6c..becf5faa 100644 --- a/src/examples/https_fileserver_example.c +++ b/src/examples/https_fileserver_example.c | |||
@@ -97,7 +97,7 @@ const char key_pem[] = | |||
97 | "-----END RSA PRIVATE KEY-----\n"; | 97 | "-----END RSA PRIVATE KEY-----\n"; |
98 | 98 | ||
99 | static int | 99 | static int |
100 | file_reader (void *cls, size_t pos, char *buf, int max) | 100 | file_reader (void *cls, uint64_t pos, char *buf, int max) |
101 | { | 101 | { |
102 | FILE *file = cls; | 102 | FILE *file = cls; |
103 | 103 | ||
@@ -112,7 +112,7 @@ http_ahc (void *cls, | |||
112 | const char *url, | 112 | const char *url, |
113 | const char *method, | 113 | const char *method, |
114 | const char *upload_data, | 114 | const char *upload_data, |
115 | const char *version, unsigned int *upload_data_size, void **ptr) | 115 | const char *version, size_t *upload_data_size, void **ptr) |
116 | { | 116 | { |
117 | static int aptr; | 117 | static int aptr; |
118 | struct MHD_Response *response; | 118 | struct MHD_Response *response; |
diff --git a/src/examples/minimal_example_comet.c b/src/examples/minimal_example_comet.c index a0f31ee2..03607f32 100644 --- a/src/examples/minimal_example_comet.c +++ b/src/examples/minimal_example_comet.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <microhttpd.h> | 26 | #include <microhttpd.h> |
27 | 27 | ||
28 | static int | 28 | static int |
29 | data_generator (void *cls, size_t pos, char *buf, int max) | 29 | data_generator (void *cls, uint64_t pos, char *buf, int max) |
30 | { | 30 | { |
31 | if (max < 80) | 31 | if (max < 80) |
32 | return 0; | 32 | return 0; |
@@ -41,7 +41,7 @@ ahc_echo (void *cls, | |||
41 | const char *url, | 41 | const char *url, |
42 | const char *method, | 42 | const char *method, |
43 | const char *version, | 43 | const char *version, |
44 | const char *upload_data, unsigned int *upload_data_size, void **ptr) | 44 | const char *upload_data, size_t *upload_data_size, void **ptr) |
45 | { | 45 | { |
46 | static int aptr; | 46 | static int aptr; |
47 | struct MHD_Response *response; | 47 | struct MHD_Response *response; |
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index ed60105c..bc617467 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -59,9 +59,9 @@ | |||
59 | * thread-safe (with the exception of 'MHD_set_connection_value', | 59 | * thread-safe (with the exception of 'MHD_set_connection_value', |
60 | * which must only be used in a particular context).<p> | 60 | * which must only be used in a particular context).<p> |
61 | * | 61 | * |
62 | * NEW: Before including "microhttpd.h" you should add the | 62 | * NEW: Before including "microhttpd.h" you should add the necessary |
63 | * necessary includes to define the "size_t", "fd_set", "socklen_t" and | 63 | * includes to define the "uint64_t", "size_t", "fd_set", "socklen_t" |
64 | * "struct sockaddr" data types (which headers are needed may | 64 | * and "struct sockaddr" data types (which headers are needed may |
65 | * depend on your platform; for possible suggestions consult | 65 | * depend on your platform; for possible suggestions consult |
66 | * "platform.h" in the MHD distribution). | 66 | * "platform.h" in the MHD distribution). |
67 | * | 67 | * |
@@ -297,8 +297,8 @@ enum MHD_OPTION | |||
297 | MHD_OPTION_END = 0, | 297 | MHD_OPTION_END = 0, |
298 | 298 | ||
299 | /** | 299 | /** |
300 | * Maximum memory size per connection (followed by an | 300 | * Maximum memory size per connection (followed by a |
301 | * unsigned int). | 301 | * size_t). |
302 | */ | 302 | */ |
303 | MHD_OPTION_CONNECTION_MEMORY_LIMIT = 1, | 303 | MHD_OPTION_CONNECTION_MEMORY_LIMIT = 1, |
304 | 304 | ||
@@ -663,7 +663,7 @@ typedef int | |||
663 | const char *method, | 663 | const char *method, |
664 | const char *version, | 664 | const char *version, |
665 | const char *upload_data, | 665 | const char *upload_data, |
666 | unsigned int *upload_data_size, | 666 | size_t *upload_data_size, |
667 | void **con_cls); | 667 | void **con_cls); |
668 | 668 | ||
669 | /** | 669 | /** |
@@ -731,7 +731,10 @@ typedef int | |||
731 | * requests using the same TCP connection). | 731 | * requests using the same TCP connection). |
732 | */ | 732 | */ |
733 | typedef int | 733 | typedef int |
734 | (*MHD_ContentReaderCallback) (void *cls, size_t pos, char *buf, int max); | 734 | (*MHD_ContentReaderCallback) (void *cls, |
735 | uint64_t pos, | ||
736 | char *buf, | ||
737 | int max); | ||
735 | 738 | ||
736 | /** | 739 | /** |
737 | * This method is called by libmicrohttpd if we | 740 | * This method is called by libmicrohttpd if we |
@@ -767,7 +770,7 @@ typedef int | |||
767 | const char *filename, | 770 | const char *filename, |
768 | const char *content_type, | 771 | const char *content_type, |
769 | const char *transfer_encoding, | 772 | const char *transfer_encoding, |
770 | const char *data, size_t off, size_t size); | 773 | const char *data, uint64_t off, size_t size); |
771 | 774 | ||
772 | /* **************** Daemon handling functions ***************** */ | 775 | /* **************** Daemon handling functions ***************** */ |
773 | 776 | ||
@@ -967,9 +970,8 @@ MHD_queue_response (struct MHD_Connection *connection, | |||
967 | * @param crfc callback to call to free crc_cls resources | 970 | * @param crfc callback to call to free crc_cls resources |
968 | * @return NULL on error (i.e. invalid arguments, out of memory) | 971 | * @return NULL on error (i.e. invalid arguments, out of memory) |
969 | */ | 972 | */ |
970 | struct MHD_Response *MHD_create_response_from_callback (size_t size, | 973 | struct MHD_Response *MHD_create_response_from_callback (uint64_t size, |
971 | unsigned int | 974 | size_t block_size, |
972 | block_size, | ||
973 | MHD_ContentReaderCallback | 975 | MHD_ContentReaderCallback |
974 | crc, void *crc_cls, | 976 | crc, void *crc_cls, |
975 | MHD_ContentReaderFreeCallback | 977 | MHD_ContentReaderFreeCallback |
@@ -1079,7 +1081,7 @@ const char *MHD_get_response_header (struct MHD_Response *response, | |||
1079 | */ | 1081 | */ |
1080 | struct MHD_PostProcessor *MHD_create_post_processor (struct MHD_Connection | 1082 | struct MHD_PostProcessor *MHD_create_post_processor (struct MHD_Connection |
1081 | *connection, | 1083 | *connection, |
1082 | unsigned int buffer_size, | 1084 | size_t buffer_size, |
1083 | MHD_PostDataIterator | 1085 | MHD_PostDataIterator |
1084 | iter, void *cls); | 1086 | iter, void *cls); |
1085 | 1087 | ||
@@ -1099,7 +1101,7 @@ struct MHD_PostProcessor *MHD_create_post_processor (struct MHD_Connection | |||
1099 | */ | 1101 | */ |
1100 | int | 1102 | int |
1101 | MHD_post_process (struct MHD_PostProcessor *pp, | 1103 | MHD_post_process (struct MHD_PostProcessor *pp, |
1102 | const char *post_data, unsigned int post_data_len); | 1104 | const char *post_data, size_t post_data_len); |
1103 | 1105 | ||
1104 | /** | 1106 | /** |
1105 | * Release PostProcessor resources. | 1107 | * Release PostProcessor resources. |
diff --git a/src/include/platform.h b/src/include/platform.h index 1252487b..a8cdb92c 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -46,6 +46,7 @@ | |||
46 | 46 | ||
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | #include <stdint.h> | ||
49 | #include <string.h> | 50 | #include <string.h> |
50 | #include <unistd.h> | 51 | #include <unistd.h> |
51 | #include <stdarg.h> | 52 | #include <stdarg.h> |
@@ -54,7 +55,7 @@ | |||
54 | #include <signal.h> | 55 | #include <signal.h> |
55 | #include <pthread.h> | 56 | #include <pthread.h> |
56 | 57 | ||
57 | /* different OSes have size_t, fd_set in | 58 | /* different OSes have fd_set in |
58 | a broad range of header files; | 59 | a broad range of header files; |
59 | we just include most of them (if they | 60 | we just include most of them (if they |
60 | are available) */ | 61 | are available) */ |
diff --git a/src/testcurl/daemon_options_test.c b/src/testcurl/daemon_options_test.c index 508585b7..1ad57a93 100644 --- a/src/testcurl/daemon_options_test.c +++ b/src/testcurl/daemon_options_test.c | |||
@@ -40,7 +40,7 @@ ahc_echo (void *cls, | |||
40 | const char *url, | 40 | const char *url, |
41 | const char *method, | 41 | const char *method, |
42 | const char *version, | 42 | const char *version, |
43 | const char *upload_data, unsigned int *upload_data_size, | 43 | const char *upload_data, size_t *upload_data_size, |
44 | void **unused) | 44 | void **unused) |
45 | { | 45 | { |
46 | return 0; | 46 | return 0; |
diff --git a/src/testcurl/daemontest_get.c b/src/testcurl/daemontest_get.c index 1e1ee946..94b15774 100644 --- a/src/testcurl/daemontest_get.c +++ b/src/testcurl/daemontest_get.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "MHD_config.h" | 28 | #include "MHD_config.h" |
29 | #include "platform.h" | ||
29 | #include <curl/curl.h> | 30 | #include <curl/curl.h> |
30 | #include <microhttpd.h> | 31 | #include <microhttpd.h> |
31 | #include <stdlib.h> | 32 | #include <stdlib.h> |
@@ -63,7 +64,7 @@ ahc_echo (void *cls, | |||
63 | const char *url, | 64 | const char *url, |
64 | const char *method, | 65 | const char *method, |
65 | const char *version, | 66 | const char *version, |
66 | const char *upload_data, unsigned int *upload_data_size, | 67 | const char *upload_data, size_t *upload_data_size, |
67 | void **unused) | 68 | void **unused) |
68 | { | 69 | { |
69 | static int ptr; | 70 | static int ptr; |
diff --git a/src/testcurl/daemontest_get_chunked.c b/src/testcurl/daemontest_get_chunked.c index ab53545c..794430e8 100644 --- a/src/testcurl/daemontest_get_chunked.c +++ b/src/testcurl/daemontest_get_chunked.c | |||
@@ -29,6 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "MHD_config.h" | 31 | #include "MHD_config.h" |
32 | #include "platform.h" | ||
32 | #include <curl/curl.h> | 33 | #include <curl/curl.h> |
33 | #include <microhttpd.h> | 34 | #include <microhttpd.h> |
34 | #include <stdlib.h> | 35 | #include <stdlib.h> |
@@ -63,7 +64,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
63 | * data in chunks. | 64 | * data in chunks. |
64 | */ | 65 | */ |
65 | static int | 66 | static int |
66 | crc (void *cls, size_t pos, char *buf, int max) | 67 | crc (void *cls, uint64_t pos, char *buf, int max) |
67 | { | 68 | { |
68 | struct MHD_Response **responseptr = cls; | 69 | struct MHD_Response **responseptr = cls; |
69 | 70 | ||
@@ -93,7 +94,7 @@ ahc_echo (void *cls, | |||
93 | const char *url, | 94 | const char *url, |
94 | const char *method, | 95 | const char *method, |
95 | const char *version, | 96 | const char *version, |
96 | const char *upload_data, unsigned int *upload_data_size, void **ptr) | 97 | const char *upload_data, size_t *upload_data_size, void **ptr) |
97 | { | 98 | { |
98 | static int aptr; | 99 | static int aptr; |
99 | const char *me = cls; | 100 | const char *me = cls; |
diff --git a/src/testcurl/daemontest_large_put.c b/src/testcurl/daemontest_large_put.c index d6fb4bcc..19e5ec4a 100644 --- a/src/testcurl/daemontest_large_put.c +++ b/src/testcurl/daemontest_large_put.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -89,7 +90,7 @@ ahc_echo (void *cls, | |||
89 | const char *url, | 90 | const char *url, |
90 | const char *method, | 91 | const char *method, |
91 | const char *version, | 92 | const char *version, |
92 | const char *upload_data, unsigned int *upload_data_size, | 93 | const char *upload_data, size_t *upload_data_size, |
93 | void **unused) | 94 | void **unused) |
94 | { | 95 | { |
95 | int *done = cls; | 96 | int *done = cls; |
diff --git a/src/testcurl/daemontest_long_header.c b/src/testcurl/daemontest_long_header.c index 9ae261c9..23823411 100644 --- a/src/testcurl/daemontest_long_header.c +++ b/src/testcurl/daemontest_long_header.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -69,7 +70,7 @@ ahc_echo (void *cls, | |||
69 | const char *url, | 70 | const char *url, |
70 | const char *method, | 71 | const char *method, |
71 | const char *version, | 72 | const char *version, |
72 | const char *upload_data, unsigned int *upload_data_size, | 73 | const char *upload_data, size_t *upload_data_size, |
73 | void **unused) | 74 | void **unused) |
74 | { | 75 | { |
75 | const char *me = cls; | 76 | const char *me = cls; |
diff --git a/src/testcurl/daemontest_parse_cookies.c b/src/testcurl/daemontest_parse_cookies.c index 13f4ad12..bfa8f860 100644 --- a/src/testcurl/daemontest_parse_cookies.c +++ b/src/testcurl/daemontest_parse_cookies.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "MHD_config.h" | 28 | #include "MHD_config.h" |
29 | #include "platform.h" | ||
29 | #include <curl/curl.h> | 30 | #include <curl/curl.h> |
30 | #include <microhttpd.h> | 31 | #include <microhttpd.h> |
31 | #include <stdlib.h> | 32 | #include <stdlib.h> |
@@ -63,7 +64,7 @@ ahc_echo (void *cls, | |||
63 | const char *url, | 64 | const char *url, |
64 | const char *method, | 65 | const char *method, |
65 | const char *version, | 66 | const char *version, |
66 | const char *upload_data, unsigned int *upload_data_size, | 67 | const char *upload_data, size_t *upload_data_size, |
67 | void **unused) | 68 | void **unused) |
68 | { | 69 | { |
69 | static int ptr; | 70 | static int ptr; |
diff --git a/src/testcurl/daemontest_post.c b/src/testcurl/daemontest_post.c index 7016334f..0ef2bbb7 100644 --- a/src/testcurl/daemontest_post.c +++ b/src/testcurl/daemontest_post.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -70,7 +71,7 @@ post_iterator (void *cls, | |||
70 | const char *filename, | 71 | const char *filename, |
71 | const char *content_type, | 72 | const char *content_type, |
72 | const char *transfer_encoding, | 73 | const char *transfer_encoding, |
73 | const char *value, size_t off, size_t size) | 74 | const char *value, uint64_t off, size_t size) |
74 | { | 75 | { |
75 | int *eok = cls; | 76 | int *eok = cls; |
76 | 77 | ||
@@ -89,7 +90,7 @@ ahc_echo (void *cls, | |||
89 | const char *url, | 90 | const char *url, |
90 | const char *method, | 91 | const char *method, |
91 | const char *version, | 92 | const char *version, |
92 | const char *upload_data, unsigned int *upload_data_size, | 93 | const char *upload_data, size_t *upload_data_size, |
93 | void **unused) | 94 | void **unused) |
94 | { | 95 | { |
95 | static int eok; | 96 | static int eok; |
diff --git a/src/testcurl/daemontest_post_loop.c b/src/testcurl/daemontest_post_loop.c index 15ec9815..0c74f96a 100644 --- a/src/testcurl/daemontest_post_loop.c +++ b/src/testcurl/daemontest_post_loop.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -66,7 +67,7 @@ ahc_echo (void *cls, | |||
66 | const char *url, | 67 | const char *url, |
67 | const char *method, | 68 | const char *method, |
68 | const char *version, | 69 | const char *version, |
69 | const char *upload_data, unsigned int *upload_data_size, | 70 | const char *upload_data, size_t *upload_data_size, |
70 | void **mptr) | 71 | void **mptr) |
71 | { | 72 | { |
72 | static int marker; | 73 | static int marker; |
diff --git a/src/testcurl/daemontest_postform.c b/src/testcurl/daemontest_postform.c index fac4b254..477713c3 100644 --- a/src/testcurl/daemontest_postform.c +++ b/src/testcurl/daemontest_postform.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -68,7 +69,7 @@ post_iterator (void *cls, | |||
68 | const char *filename, | 69 | const char *filename, |
69 | const char *content_type, | 70 | const char *content_type, |
70 | const char *transfer_encoding, | 71 | const char *transfer_encoding, |
71 | const char *value, size_t off, size_t size) | 72 | const char *value, uint64_t off, size_t size) |
72 | { | 73 | { |
73 | int *eok = cls; | 74 | int *eok = cls; |
74 | 75 | ||
@@ -90,7 +91,7 @@ ahc_echo (void *cls, | |||
90 | const char *url, | 91 | const char *url, |
91 | const char *method, | 92 | const char *method, |
92 | const char *version, | 93 | const char *version, |
93 | const char *upload_data, unsigned int *upload_data_size, | 94 | const char *upload_data, size_t *upload_data_size, |
94 | void **unused) | 95 | void **unused) |
95 | { | 96 | { |
96 | static int eok; | 97 | static int eok; |
diff --git a/src/testcurl/daemontest_process_arguments.c b/src/testcurl/daemontest_process_arguments.c index c3d19715..23fe78e3 100644 --- a/src/testcurl/daemontest_process_arguments.c +++ b/src/testcurl/daemontest_process_arguments.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "MHD_config.h" | 28 | #include "MHD_config.h" |
29 | #include "platform.h" | ||
29 | #include <curl/curl.h> | 30 | #include <curl/curl.h> |
30 | #include <microhttpd.h> | 31 | #include <microhttpd.h> |
31 | #include <stdlib.h> | 32 | #include <stdlib.h> |
@@ -63,7 +64,7 @@ ahc_echo (void *cls, | |||
63 | const char *url, | 64 | const char *url, |
64 | const char *method, | 65 | const char *method, |
65 | const char *version, | 66 | const char *version, |
66 | const char *upload_data, unsigned int *upload_data_size, | 67 | const char *upload_data, size_t *upload_data_size, |
67 | void **unused) | 68 | void **unused) |
68 | { | 69 | { |
69 | static int ptr; | 70 | static int ptr; |
diff --git a/src/testcurl/daemontest_process_headers.c b/src/testcurl/daemontest_process_headers.c index 5ab0ab1b..e59699db 100644 --- a/src/testcurl/daemontest_process_headers.c +++ b/src/testcurl/daemontest_process_headers.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "MHD_config.h" | 28 | #include "MHD_config.h" |
29 | #include "platform.h" | ||
29 | #include <curl/curl.h> | 30 | #include <curl/curl.h> |
30 | #include <microhttpd.h> | 31 | #include <microhttpd.h> |
31 | #include <stdlib.h> | 32 | #include <stdlib.h> |
@@ -75,7 +76,7 @@ ahc_echo (void *cls, | |||
75 | const char *url, | 76 | const char *url, |
76 | const char *method, | 77 | const char *method, |
77 | const char *version, | 78 | const char *version, |
78 | const char *upload_data, unsigned int *upload_data_size, | 79 | const char *upload_data, size_t *upload_data_size, |
79 | void **unused) | 80 | void **unused) |
80 | { | 81 | { |
81 | static int ptr; | 82 | static int ptr; |
diff --git a/src/testcurl/daemontest_put.c b/src/testcurl/daemontest_put.c index 2f582e3b..753af4f2 100644 --- a/src/testcurl/daemontest_put.c +++ b/src/testcurl/daemontest_put.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -76,7 +77,7 @@ ahc_echo (void *cls, | |||
76 | const char *url, | 77 | const char *url, |
77 | const char *method, | 78 | const char *method, |
78 | const char *version, | 79 | const char *version, |
79 | const char *upload_data, unsigned int *upload_data_size, | 80 | const char *upload_data, size_t *upload_data_size, |
80 | void **unused) | 81 | void **unused) |
81 | { | 82 | { |
82 | int *done = cls; | 83 | int *done = cls; |
diff --git a/src/testcurl/daemontest_put_chunked.c b/src/testcurl/daemontest_put_chunked.c index bbf614fc..96c3f79c 100644 --- a/src/testcurl/daemontest_put_chunked.c +++ b/src/testcurl/daemontest_put_chunked.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "MHD_config.h" | 28 | #include "MHD_config.h" |
29 | #include "platform.h" | ||
29 | #include <curl/curl.h> | 30 | #include <curl/curl.h> |
30 | #include <microhttpd.h> | 31 | #include <microhttpd.h> |
31 | #include <stdlib.h> | 32 | #include <stdlib.h> |
@@ -77,7 +78,7 @@ ahc_echo (void *cls, | |||
77 | const char *url, | 78 | const char *url, |
78 | const char *method, | 79 | const char *method, |
79 | const char *version, | 80 | const char *version, |
80 | const char *upload_data, unsigned int *upload_data_size, | 81 | const char *upload_data, size_t *upload_data_size, |
81 | void **unused) | 82 | void **unused) |
82 | { | 83 | { |
83 | int *done = cls; | 84 | int *done = cls; |
diff --git a/src/testcurl/https/mhds_session_info_test.c b/src/testcurl/https/mhds_session_info_test.c index 45675765..da0c2cdd 100644 --- a/src/testcurl/https/mhds_session_info_test.c +++ b/src/testcurl/https/mhds_session_info_test.c | |||
@@ -44,7 +44,7 @@ static int | |||
44 | query_session_ahc (void *cls, struct MHD_Connection *connection, | 44 | query_session_ahc (void *cls, struct MHD_Connection *connection, |
45 | const char *url, const char *method, | 45 | const char *url, const char *method, |
46 | const char *upload_data, const char *version, | 46 | const char *upload_data, const char *version, |
47 | unsigned int *upload_data_size, void **ptr) | 47 | size_t *upload_data_size, void **ptr) |
48 | { | 48 | { |
49 | struct MHD_Response *response; | 49 | struct MHD_Response *response; |
50 | int ret; | 50 | int ret; |
diff --git a/src/testcurl/https/tls_cipher_change_test.c b/src/testcurl/https/tls_cipher_change_test.c index 6890537c..6b73e1b6 100644 --- a/src/testcurl/https/tls_cipher_change_test.c +++ b/src/testcurl/https/tls_cipher_change_test.c | |||
@@ -42,7 +42,7 @@ char *http_get_req = "GET / HTTP/1.1\r\n\r\n"; | |||
42 | static int | 42 | static int |
43 | rehandshake_ahc (void *cls, struct MHD_Connection *connection, | 43 | rehandshake_ahc (void *cls, struct MHD_Connection *connection, |
44 | const char *url, const char *method, const char *upload_data, | 44 | const char *url, const char *method, const char *upload_data, |
45 | const char *version, unsigned int *upload_data_size, | 45 | const char *version, size_t *upload_data_size, |
46 | void **ptr) | 46 | void **ptr) |
47 | { | 47 | { |
48 | int ret; | 48 | int ret; |
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c index 93eb4bed..95716379 100644 --- a/src/testcurl/https/tls_test_common.c +++ b/src/testcurl/https/tls_test_common.c | |||
@@ -23,7 +23,6 @@ | |||
23 | * @brief Common tls test functions | 23 | * @brief Common tls test functions |
24 | * @author Sagie Amir | 24 | * @author Sagie Amir |
25 | */ | 25 | */ |
26 | |||
27 | #include "tls_test_common.h" | 26 | #include "tls_test_common.h" |
28 | #include "tls_test_keys.h" | 27 | #include "tls_test_keys.h" |
29 | #include "gnutls.h" | 28 | #include "gnutls.h" |
@@ -55,7 +54,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
55 | } | 54 | } |
56 | 55 | ||
57 | static int | 56 | static int |
58 | file_reader (void *cls, size_t pos, char *buf, int max) | 57 | file_reader (void *cls, uint64_t pos, char *buf, int max) |
59 | { | 58 | { |
60 | FILE *file = cls; | 59 | FILE *file = cls; |
61 | fseek (file, pos, SEEK_SET); | 60 | fseek (file, pos, SEEK_SET); |
@@ -68,7 +67,7 @@ file_reader (void *cls, size_t pos, char *buf, int max) | |||
68 | int | 67 | int |
69 | http_ahc (void *cls, struct MHD_Connection *connection, | 68 | http_ahc (void *cls, struct MHD_Connection *connection, |
70 | const char *url, const char *method, const char *upload_data, | 69 | const char *url, const char *method, const char *upload_data, |
71 | const char *version, unsigned int *upload_data_size, void **ptr) | 70 | const char *version, size_t *upload_data_size, void **ptr) |
72 | { | 71 | { |
73 | static int aptr; | 72 | static int aptr; |
74 | struct MHD_Response *response; | 73 | struct MHD_Response *response; |
@@ -112,7 +111,7 @@ http_ahc (void *cls, struct MHD_Connection *connection, | |||
112 | int | 111 | int |
113 | http_dummy_ahc (void *cls, struct MHD_Connection *connection, | 112 | http_dummy_ahc (void *cls, struct MHD_Connection *connection, |
114 | const char *url, const char *method, const char *upload_data, | 113 | const char *url, const char *method, const char *upload_data, |
115 | const char *version, unsigned int *upload_data_size, | 114 | const char *version, size_t *upload_data_size, |
116 | void **ptr) | 115 | void **ptr) |
117 | { | 116 | { |
118 | return 0; | 117 | return 0; |
diff --git a/src/testzzuf/daemontest_get.c b/src/testzzuf/daemontest_get.c index c5bb028c..ed0e7719 100644 --- a/src/testzzuf/daemontest_get.c +++ b/src/testzzuf/daemontest_get.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -64,7 +65,7 @@ ahc_echo (void *cls, | |||
64 | const char *url, | 65 | const char *url, |
65 | const char *method, | 66 | const char *method, |
66 | const char *version, | 67 | const char *version, |
67 | const char *upload_data, unsigned int *upload_data_size, | 68 | const char *upload_data, size_t *upload_data_size, |
68 | void **unused) | 69 | void **unused) |
69 | { | 70 | { |
70 | static int ptr; | 71 | static int ptr; |
diff --git a/src/testzzuf/daemontest_get_chunked.c b/src/testzzuf/daemontest_get_chunked.c index 3f6034a6..29ee5028 100644 --- a/src/testzzuf/daemontest_get_chunked.c +++ b/src/testzzuf/daemontest_get_chunked.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -61,7 +62,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
61 | * data in chunks. | 62 | * data in chunks. |
62 | */ | 63 | */ |
63 | static int | 64 | static int |
64 | crc (void *cls, size_t pos, char *buf, int max) | 65 | crc (void *cls, uint64_t pos, char *buf, int max) |
65 | { | 66 | { |
66 | struct MHD_Response **responseptr = cls; | 67 | struct MHD_Response **responseptr = cls; |
67 | 68 | ||
@@ -91,7 +92,7 @@ ahc_echo (void *cls, | |||
91 | const char *url, | 92 | const char *url, |
92 | const char *method, | 93 | const char *method, |
93 | const char *version, | 94 | const char *version, |
94 | const char *upload_data, unsigned int *upload_data_size, void **ptr) | 95 | const char *upload_data, size_t *upload_data_size, void **ptr) |
95 | { | 96 | { |
96 | static int aptr; | 97 | static int aptr; |
97 | const char *me = cls; | 98 | const char *me = cls; |
diff --git a/src/testzzuf/daemontest_large_put.c b/src/testzzuf/daemontest_large_put.c index eb8b44a0..7bdfde85 100644 --- a/src/testzzuf/daemontest_large_put.c +++ b/src/testzzuf/daemontest_large_put.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -87,7 +88,7 @@ ahc_echo (void *cls, | |||
87 | const char *url, | 88 | const char *url, |
88 | const char *method, | 89 | const char *method, |
89 | const char *version, | 90 | const char *version, |
90 | const char *upload_data, unsigned int *upload_data_size, | 91 | const char *upload_data, size_t *upload_data_size, |
91 | void **unused) | 92 | void **unused) |
92 | { | 93 | { |
93 | int *done = cls; | 94 | int *done = cls; |
diff --git a/src/testzzuf/daemontest_long_header.c b/src/testzzuf/daemontest_long_header.c index ef73b1e7..e24f8ec4 100644 --- a/src/testzzuf/daemontest_long_header.c +++ b/src/testzzuf/daemontest_long_header.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -71,7 +72,7 @@ ahc_echo (void *cls, | |||
71 | const char *url, | 72 | const char *url, |
72 | const char *method, | 73 | const char *method, |
73 | const char *version, | 74 | const char *version, |
74 | const char *upload_data, unsigned int *upload_data_size, | 75 | const char *upload_data, size_t *upload_data_size, |
75 | void **unused) | 76 | void **unused) |
76 | { | 77 | { |
77 | const char *me = cls; | 78 | const char *me = cls; |
diff --git a/src/testzzuf/daemontest_post.c b/src/testzzuf/daemontest_post.c index 1d6d9bc0..6323a5eb 100644 --- a/src/testzzuf/daemontest_post.c +++ b/src/testzzuf/daemontest_post.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -73,7 +74,7 @@ post_iterator (void *cls, | |||
73 | const char *filename, | 74 | const char *filename, |
74 | const char *content_type, | 75 | const char *content_type, |
75 | const char *transfer_encoding, | 76 | const char *transfer_encoding, |
76 | const char *value, size_t off, size_t size) | 77 | const char *value, uint64_t off, size_t size) |
77 | { | 78 | { |
78 | int *eok = cls; | 79 | int *eok = cls; |
79 | 80 | ||
@@ -92,7 +93,7 @@ ahc_echo (void *cls, | |||
92 | const char *url, | 93 | const char *url, |
93 | const char *method, | 94 | const char *method, |
94 | const char *version, | 95 | const char *version, |
95 | const char *upload_data, unsigned int *upload_data_size, | 96 | const char *upload_data, size_t *upload_data_size, |
96 | void **unused) | 97 | void **unused) |
97 | { | 98 | { |
98 | static int eok; | 99 | static int eok; |
diff --git a/src/testzzuf/daemontest_postform.c b/src/testzzuf/daemontest_postform.c index 48ddcc70..817b0bc7 100644 --- a/src/testzzuf/daemontest_postform.c +++ b/src/testzzuf/daemontest_postform.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -71,7 +72,7 @@ post_iterator (void *cls, | |||
71 | const char *filename, | 72 | const char *filename, |
72 | const char *content_type, | 73 | const char *content_type, |
73 | const char *transfer_encoding, | 74 | const char *transfer_encoding, |
74 | const char *value, size_t off, size_t size) | 75 | const char *value, uint64_t off, size_t size) |
75 | { | 76 | { |
76 | int *eok = cls; | 77 | int *eok = cls; |
77 | 78 | ||
@@ -95,7 +96,7 @@ ahc_echo (void *cls, | |||
95 | const char *url, | 96 | const char *url, |
96 | const char *method, | 97 | const char *method, |
97 | const char *version, | 98 | const char *version, |
98 | const char *upload_data, unsigned int *upload_data_size, | 99 | const char *upload_data, size_t *upload_data_size, |
99 | void **unused) | 100 | void **unused) |
100 | { | 101 | { |
101 | static int eok; | 102 | static int eok; |
diff --git a/src/testzzuf/daemontest_put.c b/src/testzzuf/daemontest_put.c index ddbcd5b4..c759e055 100644 --- a/src/testzzuf/daemontest_put.c +++ b/src/testzzuf/daemontest_put.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "MHD_config.h" | 27 | #include "MHD_config.h" |
28 | #include "platform.h" | ||
28 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
29 | #include <microhttpd.h> | 30 | #include <microhttpd.h> |
30 | #include <stdlib.h> | 31 | #include <stdlib.h> |
@@ -79,7 +80,7 @@ ahc_echo (void *cls, | |||
79 | const char *url, | 80 | const char *url, |
80 | const char *method, | 81 | const char *method, |
81 | const char *version, | 82 | const char *version, |
82 | const char *upload_data, unsigned int *upload_data_size, | 83 | const char *upload_data, size_t *upload_data_size, |
83 | void **unused) | 84 | void **unused) |
84 | { | 85 | { |
85 | int *done = cls; | 86 | int *done = cls; |
diff --git a/src/testzzuf/daemontest_put_chunked.c b/src/testzzuf/daemontest_put_chunked.c index 84c8541c..d49478ee 100644 --- a/src/testzzuf/daemontest_put_chunked.c +++ b/src/testzzuf/daemontest_put_chunked.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "MHD_config.h" | 28 | #include "MHD_config.h" |
29 | #include "platform.h" | ||
29 | #include <curl/curl.h> | 30 | #include <curl/curl.h> |
30 | #include <microhttpd.h> | 31 | #include <microhttpd.h> |
31 | #include <stdlib.h> | 32 | #include <stdlib.h> |
@@ -79,7 +80,7 @@ ahc_echo (void *cls, | |||
79 | const char *url, | 80 | const char *url, |
80 | const char *method, | 81 | const char *method, |
81 | const char *version, | 82 | const char *version, |
82 | const char *upload_data, unsigned int *upload_data_size, | 83 | const char *upload_data, size_t *upload_data_size, |
83 | void **unused) | 84 | void **unused) |
84 | { | 85 | { |
85 | int *done = cls; | 86 | int *done = cls; |