diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/daemon/response.c | 4 | ||||
-rw-r--r-- | src/examples/fileserver_example.c | 4 | ||||
-rw-r--r-- | src/examples/fileserver_example_dirs.c | 8 | ||||
-rw-r--r-- | src/examples/fileserver_example_external_select.c | 4 | ||||
-rw-r--r-- | src/examples/https_fileserver_example.c | 4 | ||||
-rw-r--r-- | src/examples/minimal_example_comet.c | 4 | ||||
-rw-r--r-- | src/include/microhttpd.h | 6 | ||||
-rw-r--r-- | src/testcurl/daemontest_get_chunked.c | 4 | ||||
-rw-r--r-- | src/testzzuf/daemontest_get_chunked.c | 4 |
10 files changed, 25 insertions, 20 deletions
@@ -1,3 +1,6 @@ | |||
1 | Tue Sep 21 15:12:41 CEST 2010 | ||
2 | Use "size_t" for buffer size instead of "int". -CG | ||
3 | |||
1 | Sat Sep 18 07:16:30 CEST 2010 | 4 | Sat Sep 18 07:16:30 CEST 2010 |
2 | Adding support for SHOUTcast. -CG | 5 | Adding support for SHOUTcast. -CG |
3 | 6 | ||
diff --git a/src/daemon/response.c b/src/daemon/response.c index ae2b8615..6700bab1 100644 --- a/src/daemon/response.c +++ b/src/daemon/response.c | |||
@@ -216,8 +216,8 @@ MHD_create_response_from_callback (uint64_t size, | |||
216 | * @param max number of bytes to write at most | 216 | * @param max number of bytes to write at most |
217 | * @return number of bytes written | 217 | * @return number of bytes written |
218 | */ | 218 | */ |
219 | static int | 219 | static ssize_t |
220 | file_reader (void *cls, uint64_t pos, char *buf, int max) | 220 | file_reader (void *cls, uint64_t pos, char *buf, size_t max) |
221 | { | 221 | { |
222 | struct MHD_Response *response = cls; | 222 | struct MHD_Response *response = cls; |
223 | int ret; | 223 | int ret; |
diff --git a/src/examples/fileserver_example.c b/src/examples/fileserver_example.c index e2258063..f470a236 100644 --- a/src/examples/fileserver_example.c +++ b/src/examples/fileserver_example.c | |||
@@ -29,8 +29,8 @@ | |||
29 | 29 | ||
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 ssize_t |
33 | file_reader (void *cls, uint64_t pos, char *buf, int max) | 33 | file_reader (void *cls, uint64_t pos, char *buf, size_t max) |
34 | { | 34 | { |
35 | FILE *file = cls; | 35 | FILE *file = cls; |
36 | 36 | ||
diff --git a/src/examples/fileserver_example_dirs.c b/src/examples/fileserver_example_dirs.c index 3bdb64ff..8c874994 100644 --- a/src/examples/fileserver_example_dirs.c +++ b/src/examples/fileserver_example_dirs.c | |||
@@ -30,8 +30,8 @@ | |||
30 | 30 | ||
31 | #define PAGE "<html><head><title>File not found</title></head><body>File not found</body></html>" | 31 | #define PAGE "<html><head><title>File not found</title></head><body>File not found</body></html>" |
32 | 32 | ||
33 | static int | 33 | static ssize_t |
34 | file_reader (void *cls, uint64_t pos, char *buf, int max) | 34 | file_reader (void *cls, uint64_t pos, char *buf, size_t max) |
35 | { | 35 | { |
36 | FILE *file = cls; | 36 | FILE *file = cls; |
37 | 37 | ||
@@ -54,8 +54,8 @@ dir_free_callback (void *cls) | |||
54 | closedir (dir); | 54 | closedir (dir); |
55 | } | 55 | } |
56 | 56 | ||
57 | static int | 57 | static ssize_t |
58 | dir_reader (void *cls, uint64_t pos, char *buf, int max) | 58 | dir_reader (void *cls, uint64_t pos, char *buf, size_t max) |
59 | { | 59 | { |
60 | DIR *dir = cls; | 60 | DIR *dir = cls; |
61 | struct dirent *e; | 61 | struct dirent *e; |
diff --git a/src/examples/fileserver_example_external_select.c b/src/examples/fileserver_example_external_select.c index 76e40c7a..aabe1d96 100644 --- a/src/examples/fileserver_example_external_select.c +++ b/src/examples/fileserver_example_external_select.c | |||
@@ -29,8 +29,8 @@ | |||
29 | 29 | ||
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 ssize_t |
33 | file_reader (void *cls, uint64_t pos, char *buf, int max) | 33 | file_reader (void *cls, uint64_t pos, char *buf, size_t 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 4df9e359..fe1512ed 100644 --- a/src/examples/https_fileserver_example.c +++ b/src/examples/https_fileserver_example.c | |||
@@ -95,8 +95,8 @@ const char key_pem[] = | |||
95 | "eRJ6DxULPxABytJrYCRrNqmXi5TCiqR2mtfalEMOPxz8rUU8dYyx\n" | 95 | "eRJ6DxULPxABytJrYCRrNqmXi5TCiqR2mtfalEMOPxz8rUU8dYyx\n" |
96 | "-----END RSA PRIVATE KEY-----\n"; | 96 | "-----END RSA PRIVATE KEY-----\n"; |
97 | 97 | ||
98 | static int | 98 | static ssize_t |
99 | file_reader (void *cls, uint64_t pos, char *buf, int max) | 99 | file_reader (void *cls, uint64_t pos, char *buf, size_t max) |
100 | { | 100 | { |
101 | FILE *file = cls; | 101 | FILE *file = cls; |
102 | 102 | ||
diff --git a/src/examples/minimal_example_comet.c b/src/examples/minimal_example_comet.c index 4aeb5db6..9b25889e 100644 --- a/src/examples/minimal_example_comet.c +++ b/src/examples/minimal_example_comet.c | |||
@@ -25,8 +25,8 @@ | |||
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #include <microhttpd.h> | 26 | #include <microhttpd.h> |
27 | 27 | ||
28 | static int | 28 | static ssize_t |
29 | data_generator (void *cls, uint64_t pos, char *buf, int max) | 29 | data_generator (void *cls, uint64_t pos, char *buf, size_t max) |
30 | { | 30 | { |
31 | if (max < 80) | 31 | if (max < 80) |
32 | return 0; | 32 | return 0; |
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index fa01680a..2ba791b9 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -866,6 +866,8 @@ typedef int | |||
866 | * libmicrohttpd guarantees that "pos" will be | 866 | * libmicrohttpd guarantees that "pos" will be |
867 | * the sum of all non-negative return values | 867 | * the sum of all non-negative return values |
868 | * obtained from the content reader so far. | 868 | * obtained from the content reader so far. |
869 | * @param buf where to copy the data | ||
870 | * @param max maximum number of bytes to copy to buf (size of buf) | ||
869 | * @return -1 for the end of transmission (or on error); | 871 | * @return -1 for the end of transmission (or on error); |
870 | * if a content transfer size was pre-set and the callback | 872 | * if a content transfer size was pre-set and the callback |
871 | * has provided fewer than that amount of data, | 873 | * has provided fewer than that amount of data, |
@@ -876,11 +878,11 @@ typedef int | |||
876 | * (possibly allowing the client to perform additional | 878 | * (possibly allowing the client to perform additional |
877 | * requests using the same TCP connection). | 879 | * requests using the same TCP connection). |
878 | */ | 880 | */ |
879 | typedef int | 881 | typedef ssize_t |
880 | (*MHD_ContentReaderCallback) (void *cls, | 882 | (*MHD_ContentReaderCallback) (void *cls, |
881 | uint64_t pos, | 883 | uint64_t pos, |
882 | char *buf, | 884 | char *buf, |
883 | int max); | 885 | size_t max); |
884 | 886 | ||
885 | /** | 887 | /** |
886 | * This method is called by libmicrohttpd if we | 888 | * This method is called by libmicrohttpd if we |
diff --git a/src/testcurl/daemontest_get_chunked.c b/src/testcurl/daemontest_get_chunked.c index 6aef68ad..e5b1a73a 100644 --- a/src/testcurl/daemontest_get_chunked.c +++ b/src/testcurl/daemontest_get_chunked.c | |||
@@ -63,8 +63,8 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
63 | * MHD content reader callback that returns | 63 | * MHD content reader callback that returns |
64 | * data in chunks. | 64 | * data in chunks. |
65 | */ | 65 | */ |
66 | static int | 66 | static ssize_t |
67 | crc (void *cls, uint64_t pos, char *buf, int max) | 67 | crc (void *cls, uint64_t pos, char *buf, size_t max) |
68 | { | 68 | { |
69 | struct MHD_Response **responseptr = cls; | 69 | struct MHD_Response **responseptr = cls; |
70 | 70 | ||
diff --git a/src/testzzuf/daemontest_get_chunked.c b/src/testzzuf/daemontest_get_chunked.c index 29ee5028..655f402a 100644 --- a/src/testzzuf/daemontest_get_chunked.c +++ b/src/testzzuf/daemontest_get_chunked.c | |||
@@ -61,8 +61,8 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
61 | * MHD content reader callback that returns | 61 | * MHD content reader callback that returns |
62 | * data in chunks. | 62 | * data in chunks. |
63 | */ | 63 | */ |
64 | static int | 64 | static ssize_t |
65 | crc (void *cls, uint64_t pos, char *buf, int max) | 65 | crc (void *cls, uint64_t pos, char *buf, size_t max) |
66 | { | 66 | { |
67 | struct MHD_Response **responseptr = cls; | 67 | struct MHD_Response **responseptr = cls; |
68 | 68 | ||