mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-10-03 04:03:18 +03:00
use size_t
This commit is contained in:
1 parent
f33a16a615
commit
b4abb360a4
10 files changed
+25
-20
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -216,8 +216,8 @@ MHD_create_response_from_callback (uint64_t size,
|
||||
* @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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 @@ dir_free_callback (void *cls)
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ const char key_pem[] =
|
||||
"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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -866,6 +866,8 @@ typedef int
|
||||
* 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 @@ typedef int
|
||||
* (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
|
||||
|
||||
@@ -63,8 +63,8 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
|
||||
* 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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user