mirror of
https://github.com/rkd77/elinks.git
synced 2025-04-18 00:47:36 -04:00
1008: Added the total_upload_length and uploaded to the http_info.
This commit is contained in:
parent
ec382345c8
commit
a685470da9
@ -659,6 +659,7 @@ send_big_files(struct socket *socket)
|
|||||||
if (n) add_bytes_to_string(&data, buffer, n);
|
if (n) add_bytes_to_string(&data, buffer, n);
|
||||||
|
|
||||||
if (finish) {
|
if (finish) {
|
||||||
|
http->uploaded += data.length;
|
||||||
request_from_socket(socket, data.source, data.length, S_SENT,
|
request_from_socket(socket, data.source, data.length, S_SENT,
|
||||||
SOCKET_END_ONCLOSE, http_got_header);
|
SOCKET_END_ONCLOSE, http_got_header);
|
||||||
} else {
|
} else {
|
||||||
@ -670,6 +671,7 @@ send_big_files(struct socket *socket)
|
|||||||
*end = BIG_FILE_CHAR;
|
*end = BIG_FILE_CHAR;
|
||||||
http->post_data = end + 1;
|
http->post_data = end + 1;
|
||||||
socket->state = SOCKET_END_ONCLOSE;
|
socket->state = SOCKET_END_ONCLOSE;
|
||||||
|
http->uploaded += data.length;
|
||||||
write_to_socket(socket, data.source, data.length, S_TRANS,
|
write_to_socket(socket, data.source, data.length, S_TRANS,
|
||||||
send_big_files2);
|
send_big_files2);
|
||||||
}
|
}
|
||||||
@ -686,6 +688,7 @@ send_big_files2(struct socket *socket)
|
|||||||
|
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
socket->state = SOCKET_END_ONCLOSE;
|
socket->state = SOCKET_END_ONCLOSE;
|
||||||
|
http->uploaded += n;
|
||||||
write_to_socket(socket, buffer, n, S_TRANS,
|
write_to_socket(socket, buffer, n, S_TRANS,
|
||||||
send_big_files2);
|
send_big_files2);
|
||||||
} else {
|
} else {
|
||||||
@ -1054,6 +1057,7 @@ http_send_header(struct socket *socket)
|
|||||||
post_data = postend ? postend + 1 : uri->post;
|
post_data = postend ? postend + 1 : uri->post;
|
||||||
add_to_string(&header, "Content-Length: ");
|
add_to_string(&header, "Content-Length: ");
|
||||||
size = post_length(post_data, &big_files);
|
size = post_length(post_data, &big_files);
|
||||||
|
http->total_upload_length = size;
|
||||||
add_long_to_string(&header, size);
|
add_long_to_string(&header, size);
|
||||||
add_crlf_to_string(&header);
|
add_crlf_to_string(&header);
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,8 @@ struct http_connection_info {
|
|||||||
int code;
|
int code;
|
||||||
|
|
||||||
/* Used by big files upload. */
|
/* Used by big files upload. */
|
||||||
|
size_t total_upload_length;
|
||||||
|
size_t uploaded;
|
||||||
unsigned char *post_data;
|
unsigned char *post_data;
|
||||||
int post_fd;
|
int post_fd;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user