diff --git a/src/connection.c b/src/connection.c index 37fb8fd..a23a126 100644 --- a/src/connection.c +++ b/src/connection.c @@ -170,7 +170,7 @@ static void conn_send_status_line(struct uh_connection *conn, int code, const ch conn_send(conn, extra_headers, strlen(extra_headers)); } -static void conn_send_head(struct uh_connection *conn, int code, int content_length, const char *extra_headers) +static void conn_send_head(struct uh_connection *conn, int code, int64_t content_length, const char *extra_headers) { struct uh_connection_internal *conni = (struct uh_connection_internal *)conn; @@ -178,7 +178,7 @@ static void conn_send_head(struct uh_connection *conn, int code, int content_len if (content_length < 0) conn_printf(conn, "%s", "Transfer-Encoding: chunked\r\n"); else - conn_printf(conn, "Content-Length: %d\r\n", content_length); + conn_printf(conn, "Content-Length: %" PRIu64 "\r\n", content_length); if (!http_should_keep_alive(&conni->parser)) conn_printf(conn, "%s", "Connection: close\r\n"); diff --git a/src/uhttpd.h b/src/uhttpd.h index 87c977c..2d3d3cf 100644 --- a/src/uhttpd.h +++ b/src/uhttpd.h @@ -61,7 +61,7 @@ struct uh_connection { void (*printf)(struct uh_connection *conn, const char *format, ...) __attribute__((format(printf, 2, 3))); void (*vprintf)(struct uh_connection *conn, const char *format, va_list arg); void (*send_status_line)(struct uh_connection *conn, int code, const char *extra_headers); - void (*send_head)(struct uh_connection *conn, int code, int content_length, const char *extra_headers); + void (*send_head)(struct uh_connection *conn, int code, int64_t content_length, const char *extra_headers); void (*error)(struct uh_connection *conn, int code, const char *reason); void (*redirect)(struct uh_connection *conn, int code, const char *location, ...) __attribute__((format(printf, 3, 4))); void (*serve_file)(struct uh_connection *conn);