Browse Source

Keep HTTP progress updated, and display a progress indicator during the

download
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
bde8878eef
3 changed files with 10 additions and 4 deletions
  1. 2
    1
      src/core/download.c
  2. 4
    0
      src/net/tcp/http.c
  3. 4
    3
      src/usr/imgmgmt.c

+ 2
- 1
src/core/download.c View File

170
 static struct async_operations download_async_operations = {
170
 static struct async_operations download_async_operations = {
171
 	.reap = download_reap,
171
 	.reap = download_reap,
172
 	.signal = {
172
 	.signal = {
173
-		[SIGCHLD] = download_sigchld,
173
+		[SIGCHLD]	= download_sigchld,
174
+		[SIGUPDATE]	= SIG_IGN,
174
 	},
175
 	},
175
 };
176
 };

+ 4
- 0
src/net/tcp/http.c View File

253
 		return;
253
 		return;
254
 	}
254
 	}
255
 
255
 
256
+	/* Update progress */
257
+	http->async.completed = http->buffer->fill;
258
+	http->async.total = http->content_length;
259
+
256
 	/* If we have reached the content-length, stop now */
260
 	/* If we have reached the content-length, stop now */
257
 	if ( http->content_length &&
261
 	if ( http->content_length &&
258
 	     ( http->buffer->fill >= http->content_length ) ) {
262
 	     ( http->buffer->fill >= http->content_length ) ) {

+ 4
- 3
src/usr/imgmgmt.c View File

56
 		strncpy ( image->name, name, ( sizeof ( image->name ) - 1 ) );
56
 		strncpy ( image->name, name, ( sizeof ( image->name ) - 1 ) );
57
 
57
 
58
 	/* Download the file */
58
 	/* Download the file */
59
-	if ( ( rc = async_block ( &async, start_download ( uri_string, &async,
60
-							   &image->data,
61
-							   &image->len ))) !=0)
59
+	if ( ( rc = async_block_progress ( &async,
60
+					   start_download ( uri_string, &async,
61
+							    &image->data,
62
+							    &image->len )))!=0)
62
 		goto err;
63
 		goto err;
63
 
64
 
64
 	/* Register the image */
65
 	/* Register the image */

Loading…
Cancel
Save