mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-09 16:21:45 +00:00
commit
524aa2e586
1 file changed
+7
-2
+7
-2
@@ -42,11 +42,16 @@
|
|||||||
|
|
||||||
#undef UNICODE // Use ANSI WinAPI functions
|
#undef UNICODE // Use ANSI WinAPI functions
|
||||||
#undef _UNICODE // Use multibyte encoding on Windows
|
#undef _UNICODE // Use multibyte encoding on Windows
|
||||||
|
#ifndef _MBCS
|
||||||
#define _MBCS // Use multibyte encoding on Windows
|
#define _MBCS // Use multibyte encoding on Windows
|
||||||
|
#endif
|
||||||
#define _INTEGRAL_MAX_BITS 64 // Enable _stati64() on Windows
|
#define _INTEGRAL_MAX_BITS 64 // Enable _stati64() on Windows
|
||||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||||
#define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005+
|
#define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005+
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS
|
||||||
|
#define _WINSOCK_DEPRECATED_NO_WARNINGS // Disable deprecated Winsock API warnings in VS2013+
|
||||||
|
#endif
|
||||||
#undef WIN32_LEAN_AND_MEAN // Let windows.h always include winsock2.h
|
#undef WIN32_LEAN_AND_MEAN // Let windows.h always include winsock2.h
|
||||||
#ifdef __Linux__
|
#ifdef __Linux__
|
||||||
#define _XOPEN_SOURCE 600 // For flockfile() on Linux
|
#define _XOPEN_SOURCE 600 // For flockfile() on Linux
|
||||||
@@ -3887,7 +3892,7 @@ static void handle_put(struct connection *conn, const char *path) {
|
|||||||
|
|
||||||
static void forward_put_data(struct connection *conn) {
|
static void forward_put_data(struct connection *conn) {
|
||||||
struct iobuf *io = &conn->ns_conn->recv_iobuf;
|
struct iobuf *io = &conn->ns_conn->recv_iobuf;
|
||||||
size_t k = conn->cl < (int64_t) io->len ? conn->cl : (int64_t) io->len; // To write
|
size_t k = (size_t)(conn->cl < (int64_t) io->len ? conn->cl : (int64_t) io->len); // To write
|
||||||
size_t n = write(conn->endpoint.fd, io->buf, k); // Write them!
|
size_t n = write(conn->endpoint.fd, io->buf, k); // Write them!
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
iobuf_remove(io, n);
|
iobuf_remove(io, n);
|
||||||
@@ -4796,7 +4801,7 @@ static void on_recv_data(struct connection *conn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (conn->ns_conn->flags & NSF_DISCARD) {
|
if (conn->ns_conn->flags & NSF_DISCARD) {
|
||||||
size_t n = conn->cl;
|
size_t n = (size_t)conn->cl;
|
||||||
if (n > io->len) {
|
if (n > io->len) {
|
||||||
n = io->len;
|
n = io->len;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user