From 473e2a1cb21877057298da55a26203765307d076 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Thu, 12 Dec 2013 13:51:14 +0000 Subject: [PATCH] Added for linux, and squashed warning in transfer_file_data() --- mongoose.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index 5699e555..b5078b25 100644 --- a/mongoose.c +++ b/mongoose.c @@ -88,6 +88,7 @@ typedef struct _stati64 file_stat_t; #include #include #include +#include #include // For inet_pton() when USE_IPV6 is defined #include #include @@ -3008,7 +3009,7 @@ static void close_local_endpoint(struct connection *conn) { static void transfer_file_data(struct connection *conn) { char buf[IOBUF_SIZE]; int n = read(conn->endpoint.fd, buf, - conn->cl < (int64_t) sizeof(buf) ? (int) conn->cl : sizeof(buf)); + conn->cl < (int64_t) sizeof(buf) ? conn->cl : (int) sizeof(buf)); if (is_error(n)) { close_local_endpoint(conn);