mirror of
https://github.com/ipxe/ipxe
synced 2025-12-13 23:41:45 +03:00
Keep HTTP progress updated, and display a progress indicator during the
download
This commit is contained in:
@@ -171,5 +171,6 @@ static struct async_operations download_async_operations = {
|
|||||||
.reap = download_reap,
|
.reap = download_reap,
|
||||||
.signal = {
|
.signal = {
|
||||||
[SIGCHLD] = download_sigchld,
|
[SIGCHLD] = download_sigchld,
|
||||||
|
[SIGUPDATE] = SIG_IGN,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -253,6 +253,10 @@ static void http_rx_data ( struct http_request *http,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Update progress */
|
||||||
|
http->async.completed = http->buffer->fill;
|
||||||
|
http->async.total = http->content_length;
|
||||||
|
|
||||||
/* If we have reached the content-length, stop now */
|
/* If we have reached the content-length, stop now */
|
||||||
if ( http->content_length &&
|
if ( http->content_length &&
|
||||||
( http->buffer->fill >= http->content_length ) ) {
|
( http->buffer->fill >= http->content_length ) ) {
|
||||||
|
|||||||
@@ -56,9 +56,10 @@ int imgfetch ( const char *uri_string, const char *name,
|
|||||||
strncpy ( image->name, name, ( sizeof ( image->name ) - 1 ) );
|
strncpy ( image->name, name, ( sizeof ( image->name ) - 1 ) );
|
||||||
|
|
||||||
/* Download the file */
|
/* Download the file */
|
||||||
if ( ( rc = async_block ( &async, start_download ( uri_string, &async,
|
if ( ( rc = async_block_progress ( &async,
|
||||||
|
start_download ( uri_string, &async,
|
||||||
&image->data,
|
&image->data,
|
||||||
&image->len ))) !=0)
|
&image->len )))!=0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/* Register the image */
|
/* Register the image */
|
||||||
|
|||||||
Reference in New Issue
Block a user