send_head: use int64_t for content_length
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>main^2
parent
b2e52fe1af
commit
2f951e5166
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue