mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05: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 (finish) {
|
||||
http->uploaded += data.length;
|
||||
request_from_socket(socket, data.source, data.length, S_SENT,
|
||||
SOCKET_END_ONCLOSE, http_got_header);
|
||||
} else {
|
||||
@ -670,6 +671,7 @@ send_big_files(struct socket *socket)
|
||||
*end = BIG_FILE_CHAR;
|
||||
http->post_data = end + 1;
|
||||
socket->state = SOCKET_END_ONCLOSE;
|
||||
http->uploaded += data.length;
|
||||
write_to_socket(socket, data.source, data.length, S_TRANS,
|
||||
send_big_files2);
|
||||
}
|
||||
@ -686,6 +688,7 @@ send_big_files2(struct socket *socket)
|
||||
|
||||
if (n > 0) {
|
||||
socket->state = SOCKET_END_ONCLOSE;
|
||||
http->uploaded += n;
|
||||
write_to_socket(socket, buffer, n, S_TRANS,
|
||||
send_big_files2);
|
||||
} else {
|
||||
@ -1054,6 +1057,7 @@ http_send_header(struct socket *socket)
|
||||
post_data = postend ? postend + 1 : uri->post;
|
||||
add_to_string(&header, "Content-Length: ");
|
||||
size = post_length(post_data, &big_files);
|
||||
http->total_upload_length = size;
|
||||
add_long_to_string(&header, size);
|
||||
add_crlf_to_string(&header);
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ struct http_connection_info {
|
||||
int code;
|
||||
|
||||
/* Used by big files upload. */
|
||||
size_t total_upload_length;
|
||||
size_t uploaded;
|
||||
unsigned char *post_data;
|
||||
int post_fd;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user