mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
updated to use the new set of progress-functions
This commit is contained in:
parent
efb410a188
commit
5a99be2545
@ -243,6 +243,10 @@ UrgError dict(struct UrlData *data, char *path, long *bytecount)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
ProgressEnd(data);
|
ProgressEnd(data);
|
||||||
|
#endif
|
||||||
|
pgrsDone(data);
|
||||||
|
|
||||||
return URG_OK;
|
return URG_OK;
|
||||||
}
|
}
|
||||||
|
11
lib/file.c
11
lib/file.c
@ -145,7 +145,12 @@ UrgError file(struct UrlData *data, char *path, long *bytecountp)
|
|||||||
this is both more efficient than the former call to download() and
|
this is both more efficient than the former call to download() and
|
||||||
it avoids problems with select() and recv() on file descriptors
|
it avoids problems with select() and recv() on file descriptors
|
||||||
in Winsock */
|
in Winsock */
|
||||||
|
#if 0
|
||||||
ProgressInit (data, expected_size);
|
ProgressInit (data, expected_size);
|
||||||
|
#endif
|
||||||
|
if(expected_size != -1)
|
||||||
|
pgrsSetDownloadSize(data, expected_size);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
nread = read(fd, buf, BUFSIZE-1);
|
nread = read(fd, buf, BUFSIZE-1);
|
||||||
|
|
||||||
@ -164,10 +169,16 @@ UrgError file(struct UrlData *data, char *path, long *bytecountp)
|
|||||||
return URG_WRITE_ERROR;
|
return URG_WRITE_ERROR;
|
||||||
}
|
}
|
||||||
now = tvnow();
|
now = tvnow();
|
||||||
|
pgrsUpdate(data);
|
||||||
|
#if 0
|
||||||
ProgressShow (data, bytecount, start, now, FALSE);
|
ProgressShow (data, bytecount, start, now, FALSE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
now = tvnow();
|
now = tvnow();
|
||||||
|
#if 0
|
||||||
ProgressShow (data, bytecount, start, now, TRUE);
|
ProgressShow (data, bytecount, start, now, TRUE);
|
||||||
|
#endif
|
||||||
|
pgrsUpdate(data);
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
@ -752,7 +752,10 @@ UrgError _ftp(struct UrlData *data,
|
|||||||
/* When we know we're uploading a specified file, we can get the file
|
/* When we know we're uploading a specified file, we can get the file
|
||||||
size prior to the actual upload. */
|
size prior to the actual upload. */
|
||||||
|
|
||||||
|
pgrsSetUploadSize(data, data->infilesize);
|
||||||
|
#if 0
|
||||||
ProgressInit(data, data->infilesize);
|
ProgressInit(data, data->infilesize);
|
||||||
|
#endif
|
||||||
result = Transfer(data, -1, -1, FALSE, NULL, /* no download */
|
result = Transfer(data, -1, -1, FALSE, NULL, /* no download */
|
||||||
data->secondarysocket, bytecountp);
|
data->secondarysocket, bytecountp);
|
||||||
if(result)
|
if(result)
|
||||||
@ -999,7 +1002,10 @@ UrgError _ftp(struct UrlData *data,
|
|||||||
|
|
||||||
}
|
}
|
||||||
/* end of transfer */
|
/* end of transfer */
|
||||||
|
#if 0
|
||||||
ProgressEnd(data);
|
ProgressEnd(data);
|
||||||
|
#endif
|
||||||
|
pgrsDone(data);
|
||||||
|
|
||||||
/* shut down the socket to inform the server we're done */
|
/* shut down the socket to inform the server we're done */
|
||||||
sclose(data->secondarysocket);
|
sclose(data->secondarysocket);
|
||||||
|
10
lib/http.c
10
lib/http.c
@ -318,7 +318,10 @@ UrgError http(struct UrlData *data, char *ppath, char *host, long *bytecount)
|
|||||||
"Content-Length: %d\r\n",
|
"Content-Length: %d\r\n",
|
||||||
postsize-2);
|
postsize-2);
|
||||||
|
|
||||||
|
pgrsSetUploadSize(data, postsize);
|
||||||
|
#if 0
|
||||||
ProgressInit(data, postsize);
|
ProgressInit(data, postsize);
|
||||||
|
#endif
|
||||||
|
|
||||||
result = Transfer(data, data->firstsocket, -1, TRUE, &readbytecount,
|
result = Transfer(data, data->firstsocket, -1, TRUE, &readbytecount,
|
||||||
data->firstsocket, &writebytecount);
|
data->firstsocket, &writebytecount);
|
||||||
@ -349,7 +352,10 @@ UrgError http(struct UrlData *data, char *ppath, char *host, long *bytecount)
|
|||||||
sendf(data->firstsocket, data,
|
sendf(data->firstsocket, data,
|
||||||
"\015\012");
|
"\015\012");
|
||||||
|
|
||||||
|
#if 0
|
||||||
ProgressInit(data, data->infilesize);
|
ProgressInit(data, data->infilesize);
|
||||||
|
#endif
|
||||||
|
pgrsSetUploadSize(data, data->infilesize);
|
||||||
|
|
||||||
result = Transfer(data, data->firstsocket, -1, TRUE, &readbytecount,
|
result = Transfer(data, data->firstsocket, -1, TRUE, &readbytecount,
|
||||||
data->firstsocket, &writebytecount);
|
data->firstsocket, &writebytecount);
|
||||||
@ -371,7 +377,11 @@ UrgError http(struct UrlData *data, char *ppath, char *host, long *bytecount)
|
|||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
#if 0
|
||||||
ProgressEnd(data);
|
ProgressEnd(data);
|
||||||
|
#endif
|
||||||
|
pgrsDone(data);
|
||||||
|
|
||||||
} while (0); /* this is just a left-over from the multiple document download
|
} while (0); /* this is just a left-over from the multiple document download
|
||||||
attempts */
|
attempts */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user