gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r13047 - in libmicrohttpd: . src/daemon src/examples src/in


From: gnunet
Subject: [GNUnet-SVN] r13047 - in libmicrohttpd: . src/daemon src/examples src/include src/testcurl src/testzzuf
Date: Tue, 21 Sep 2010 15:13:05 +0200

Author: grothoff
Date: 2010-09-21 15:13:05 +0200 (Tue, 21 Sep 2010)
New Revision: 13047

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/daemon/response.c
   libmicrohttpd/src/examples/fileserver_example.c
   libmicrohttpd/src/examples/fileserver_example_dirs.c
   libmicrohttpd/src/examples/fileserver_example_external_select.c
   libmicrohttpd/src/examples/https_fileserver_example.c
   libmicrohttpd/src/examples/minimal_example_comet.c
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/testcurl/daemontest_get_chunked.c
   libmicrohttpd/src/testzzuf/daemontest_get_chunked.c
Log:
use size_t

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2010-09-21 12:57:16 UTC (rev 13046)
+++ libmicrohttpd/ChangeLog     2010-09-21 13:13:05 UTC (rev 13047)
@@ -1,3 +1,6 @@
+Tue Sep 21 15:12:41 CEST 2010
+       Use "size_t" for buffer size instead of "int". -CG
+
 Sat Sep 18 07:16:30 CEST 2010
        Adding support for SHOUTcast. -CG
 

Modified: libmicrohttpd/src/daemon/response.c
===================================================================
--- libmicrohttpd/src/daemon/response.c 2010-09-21 12:57:16 UTC (rev 13046)
+++ libmicrohttpd/src/daemon/response.c 2010-09-21 13:13:05 UTC (rev 13047)
@@ -216,8 +216,8 @@
  * @param max number of bytes to write at most
  * @return number of bytes written
  */
-static int
-file_reader (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+file_reader (void *cls, uint64_t pos, char *buf, size_t max)
 {
   struct MHD_Response *response = cls;
   int ret;

Modified: libmicrohttpd/src/examples/fileserver_example.c
===================================================================
--- libmicrohttpd/src/examples/fileserver_example.c     2010-09-21 12:57:16 UTC 
(rev 13046)
+++ libmicrohttpd/src/examples/fileserver_example.c     2010-09-21 13:13:05 UTC 
(rev 13047)
@@ -29,8 +29,8 @@
 
 #define PAGE "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
-static int
-file_reader (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+file_reader (void *cls, uint64_t pos, char *buf, size_t max)
 {
   FILE *file = cls;
 

Modified: libmicrohttpd/src/examples/fileserver_example_dirs.c
===================================================================
--- libmicrohttpd/src/examples/fileserver_example_dirs.c        2010-09-21 
12:57:16 UTC (rev 13046)
+++ libmicrohttpd/src/examples/fileserver_example_dirs.c        2010-09-21 
13:13:05 UTC (rev 13047)
@@ -30,8 +30,8 @@
 
 #define PAGE "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
-static int
-file_reader (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+file_reader (void *cls, uint64_t pos, char *buf, size_t max)
 {
   FILE *file = cls;
 
@@ -54,8 +54,8 @@
     closedir (dir);
 }
 
-static int
-dir_reader (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+dir_reader (void *cls, uint64_t pos, char *buf, size_t max)
 {
   DIR *dir = cls;
   struct dirent *e;

Modified: libmicrohttpd/src/examples/fileserver_example_external_select.c
===================================================================
--- libmicrohttpd/src/examples/fileserver_example_external_select.c     
2010-09-21 12:57:16 UTC (rev 13046)
+++ libmicrohttpd/src/examples/fileserver_example_external_select.c     
2010-09-21 13:13:05 UTC (rev 13047)
@@ -29,8 +29,8 @@
 
 #define PAGE "<html><head><title>File not found</title></head><body>File not 
found</body></html>"
 
-static int
-file_reader (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+file_reader (void *cls, uint64_t pos, char *buf, size_t max)
 {
   FILE *file = cls;
 

Modified: libmicrohttpd/src/examples/https_fileserver_example.c
===================================================================
--- libmicrohttpd/src/examples/https_fileserver_example.c       2010-09-21 
12:57:16 UTC (rev 13046)
+++ libmicrohttpd/src/examples/https_fileserver_example.c       2010-09-21 
13:13:05 UTC (rev 13047)
@@ -95,8 +95,8 @@
   "eRJ6DxULPxABytJrYCRrNqmXi5TCiqR2mtfalEMOPxz8rUU8dYyx\n"
   "-----END RSA PRIVATE KEY-----\n";
 
-static int
-file_reader (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+file_reader (void *cls, uint64_t pos, char *buf, size_t max)
 {
   FILE *file = cls;
 

Modified: libmicrohttpd/src/examples/minimal_example_comet.c
===================================================================
--- libmicrohttpd/src/examples/minimal_example_comet.c  2010-09-21 12:57:16 UTC 
(rev 13046)
+++ libmicrohttpd/src/examples/minimal_example_comet.c  2010-09-21 13:13:05 UTC 
(rev 13047)
@@ -25,8 +25,8 @@
 #include "platform.h"
 #include <microhttpd.h>
 
-static int
-data_generator (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+data_generator (void *cls, uint64_t pos, char *buf, size_t max)
 {
   if (max < 80)
     return 0;

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2010-09-21 12:57:16 UTC (rev 
13046)
+++ libmicrohttpd/src/include/microhttpd.h      2010-09-21 13:13:05 UTC (rev 
13047)
@@ -866,6 +866,8 @@
  *        libmicrohttpd guarantees that "pos" will be
  *        the sum of all non-negative return values
  *        obtained from the content reader so far.
+ * @param buf where to copy the data
+ * @param max maximum number of bytes to copy to buf (size of buf)
  * @return -1 for the end of transmission (or on error);
  *  if a content transfer size was pre-set and the callback
  *  has provided fewer than that amount of data,
@@ -876,11 +878,11 @@
  *  (possibly allowing the client to perform additional
  *  requests using the same TCP connection).
  */
-typedef int
+typedef ssize_t
   (*MHD_ContentReaderCallback) (void *cls,
                                uint64_t pos,
                                char *buf,
-                               int max);
+                               size_t max);
 
 /**
  * This method is called by libmicrohttpd if we

Modified: libmicrohttpd/src/testcurl/daemontest_get_chunked.c
===================================================================
--- libmicrohttpd/src/testcurl/daemontest_get_chunked.c 2010-09-21 12:57:16 UTC 
(rev 13046)
+++ libmicrohttpd/src/testcurl/daemontest_get_chunked.c 2010-09-21 13:13:05 UTC 
(rev 13047)
@@ -63,8 +63,8 @@
  * MHD content reader callback that returns
  * data in chunks.
  */
-static int
-crc (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+crc (void *cls, uint64_t pos, char *buf, size_t max)
 {
   struct MHD_Response **responseptr = cls;
 

Modified: libmicrohttpd/src/testzzuf/daemontest_get_chunked.c
===================================================================
--- libmicrohttpd/src/testzzuf/daemontest_get_chunked.c 2010-09-21 12:57:16 UTC 
(rev 13046)
+++ libmicrohttpd/src/testzzuf/daemontest_get_chunked.c 2010-09-21 13:13:05 UTC 
(rev 13047)
@@ -61,8 +61,8 @@
  * MHD content reader callback that returns
  * data in chunks.
  */
-static int
-crc (void *cls, uint64_t pos, char *buf, int max)
+static ssize_t
+crc (void *cls, uint64_t pos, char *buf, size_t max)
 {
   struct MHD_Response **responseptr = cls;
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]