1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

more fixing to make the progress/getinfo stuff to work properly when doing

file: transfers too
This commit is contained in:
Daniel Stenberg 2004-03-05 09:40:16 +00:00
parent ef0a2c714b
commit 6717240650
2 changed files with 11 additions and 3 deletions

View File

@ -83,6 +83,7 @@
#include "escape.h" #include "escape.h"
#include "file.h" #include "file.h"
#include "speedcheck.h" #include "speedcheck.h"
#include "getinfo.h"
#define _MPRINTF_REPLACE /* use our functions only */ #define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h> #include <curl/mprintf.h>
@ -177,10 +178,14 @@ CURLcode Curl_file(struct connectdata *conn)
int fd; int fd;
struct timeval now = Curl_tvnow(); struct timeval now = Curl_tvnow();
Curl_readwrite_init(conn);
Curl_initinfo(data);
Curl_pgrsStartNow(data);
/* get the fd from the connection phase */ /* get the fd from the connection phase */
fd = conn->proto.file->fd; fd = conn->proto.file->fd;
/*VMS?? -- This only works reliable for STREAMLF files */ /* VMS: This only works reliable for STREAMLF files */
if( -1 != fstat(fd, &statbuf)) { if( -1 != fstat(fd, &statbuf)) {
/* we could stat it, then read out the size */ /* we could stat it, then read out the size */
expected_size = statbuf.st_size; expected_size = statbuf.st_size;

View File

@ -1386,7 +1386,7 @@ void Curl_single_fdset(struct connectdata *conn,
* The transfer must already have been setup by a call to Curl_Transfer(). * The transfer must already have been setup by a call to Curl_Transfer().
* *
* Note that headers are created in a preallocated buffer of a default size. * Note that headers are created in a preallocated buffer of a default size.
* That buffer can be enlarged on demand, but it is never shrinken again. * That buffer can be enlarged on demand, but it is never shrunken again.
* *
* Parts of this function was once written by the friendly Mark Butler * Parts of this function was once written by the friendly Mark Butler
* <butlerm@xmission.com>. * <butlerm@xmission.com>.
@ -1400,6 +1400,9 @@ Transfer(struct connectdata *conn)
struct Curl_transfer_keeper *k = &conn->keep; struct Curl_transfer_keeper *k = &conn->keep;
bool done=FALSE; bool done=FALSE;
if(!(conn->protocol & PROT_FILE))
/* Only do this if we are not transferring FILE:, since the file: treatment
is different*/
Curl_readwrite_init(conn); Curl_readwrite_init(conn);
if((conn->sockfd == -1) && (conn->writesockfd == -1)) if((conn->sockfd == -1) && (conn->writesockfd == -1))