From d46d107e0cc421f74e1ed632b14cc72c2ffb2c14 Mon Sep 17 00:00:00 2001 From: Jiri Hruska Date: Fri, 1 Mar 2013 19:38:27 +0100 Subject: imap: Updated setting of transfer variables in imap_state_fetch_resp() Add number of bytes retrieved from the PP cache to req.bytecount and set req.maxdownload only when starting a proper download. --- lib/imap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/imap.c') diff --git a/lib/imap.c b/lib/imap.c index 8b00b216d..dcc6d6b6e 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1294,6 +1294,7 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode, if(result) return result; + data->req.bytecount += chunk; size -= chunk; infof(data, "Written %" FORMAT_OFF_TU " bytes, %" FORMAT_OFF_TU @@ -1317,11 +1318,11 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode, if(!size) /* The entire data is already transferred! */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); - else + else { /* IMAP download */ + data->req.maxdownload = size; Curl_setup_transfer(conn, FIRSTSOCKET, size, FALSE, NULL, -1, NULL); - - data->req.maxdownload = size; + } } else { /* We don't know how to parse this line */ -- cgit v1.2.3