Changes in uspace/app/download/main.c [d5c1051:9713b0b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/download/main.c
rd5c1051 r9713b0b 74 74 http_t *http = NULL; 75 75 int rc; 76 int ret;77 76 78 77 if (argc < 2) { … … 156 155 } 157 156 } else { 158 r et= asprintf(&server_path, "%s?%s", path, uri->query);159 if (r et< 0) {157 rc = asprintf(&server_path, "%s?%s", path, uri->query); 158 if (rc < 0) { 160 159 fprintf(stderr, "Failed allocating path\n"); 161 160 rc = ENOMEM; … … 225 224 } 226 225 227 size_t body_size;228 while (( rc = recv_buffer(&http->recv_buffer, buf, buf_size, &body_size)) == EOK && body_size> 0) {226 int body_size; 227 while ((body_size = recv_buffer(&http->recv_buffer, buf, buf_size)) > 0) { 229 228 fwrite(buf, 1, body_size, ofile != NULL ? ofile : stdout); 230 229 } 231 230 232 if ( rc != EOK) {233 fprintf(stderr, "Failed receiving body: %s", str_error( rc));231 if (body_size != 0) { 232 fprintf(stderr, "Failed receiving body: %s", str_error(body_size)); 234 233 } 235 234 }
Note:
See TracChangeset
for help on using the changeset viewer.