0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-06-30 22:19:29 -04:00

1008: rename connection.upload_progress to .http_upload_progress

This commit is contained in:
Kalle Olavi Niemitalo 2008-06-03 09:57:58 +03:00 committed by Kalle Olavi Niemitalo
parent fa51846f68
commit 08941fd47d
4 changed files with 18 additions and 10 deletions

View File

@ -55,8 +55,8 @@ get_download_msg(struct download *download, struct terminal *term,
&& download->conn->uri->protocol == PROTOCOL_BITTORRENT) && download->conn->uri->protocol == PROTOCOL_BITTORRENT)
return get_bittorrent_message(download, term, wide, full, separator); return get_bittorrent_message(download, term, wide, full, separator);
#endif #endif
if (download->conn && download->conn->upload_progress) if (download->conn && download->conn->http_upload_progress)
return get_upload_progress_msg(download->conn->upload_progress, return get_upload_progress_msg(download->conn->http_upload_progress,
term, wide, full, separator); term, wide, full, separator);
return get_progress_msg(download->progress, term, wide, full, separator); return get_progress_msg(download->progress, term, wide, full, separator);

View File

@ -343,10 +343,10 @@ upload_stat_timer(struct connection *conn)
{ {
struct http_connection_info *http = conn->info; struct http_connection_info *http = conn->info;
assert(conn->upload_progress && http); assert(conn->http_upload_progress && http);
if_assert_failed return; if_assert_failed return;
update_progress(conn->upload_progress, http->post.uploaded, update_progress(conn->http_upload_progress, http->post.uploaded,
http->post.total_upload_length, http->post.uploaded); http->post.total_upload_length, http->post.uploaded);
notify_connection_callbacks(conn); notify_connection_callbacks(conn);
} }
@ -356,7 +356,7 @@ set_connection_state(struct connection *conn, enum connection_state state)
{ {
struct download *download; struct download *download;
struct progress *progress = conn->progress; struct progress *progress = conn->progress;
struct progress *upload_progress = conn->upload_progress; struct progress *upload_progress = conn->http_upload_progress;
if (is_in_result_state(conn->state) && is_in_progress_state(state)) if (is_in_result_state(conn->state) && is_in_progress_state(state))
conn->prev_error = conn->state; conn->prev_error = conn->state;
@ -501,8 +501,8 @@ done_connection(struct connection *conn)
mem_free(conn->socket); mem_free(conn->socket);
mem_free(conn->data_socket); mem_free(conn->data_socket);
done_progress(conn->progress); done_progress(conn->progress);
if (conn->upload_progress) if (conn->http_upload_progress)
done_progress(conn->upload_progress); done_progress(conn->http_upload_progress);
mem_free(conn); mem_free(conn);
check_queue_bugs(); check_queue_bugs();
} }

View File

@ -18,7 +18,15 @@ struct connection {
LIST_OF(struct download) downloads; LIST_OF(struct download) downloads;
struct progress *progress; struct progress *progress;
struct progress *upload_progress;
/** Progress of sending the request and attached files to the
* server. This happens before any download.
*
* Currently, ELinks supports file uploads only in HTTP and
* local CGI. Therefore, upload_stat_timer() in connection.c
* assumes that #info points to struct http_connection_info
* whenever @c http_upload_progress is not NULL. */
struct progress *http_upload_progress;
/* If no proxy is used uri and proxied_uri are the same. */ /* If no proxy is used uri and proxied_uri are the same. */
struct uri *uri; struct uri *uri;

View File

@ -1013,8 +1013,8 @@ http_send_header(struct socket *socket)
assert(!use_connect); /* see comment above */ assert(!use_connect); /* see comment above */
socket->state = SOCKET_END_ONCLOSE; socket->state = SOCKET_END_ONCLOSE;
if (!conn->upload_progress && http->post.file_count) if (!conn->http_upload_progress && http->post.file_count)
conn->upload_progress = init_progress(0); conn->http_upload_progress = init_progress(0);
write_to_socket(socket, header.source, header.length, S_TRANS, write_to_socket(socket, header.source, header.length, S_TRANS,
send_more_post_data); send_more_post_data);
} else } else