*/
-void Curl_pgrsDone(struct connectdata *conn)
+int Curl_pgrsDone(struct connectdata *conn)
{
+ int rc;
struct SessionHandle *data = conn->data;
data->progress.lastshow=0;
- Curl_pgrsUpdate(conn); /* the final (forced) update */
+ rc = Curl_pgrsUpdate(conn); /* the final (forced) update */
+ if(rc)
+ return rc;
if(!(data->progress.flags & PGRS_HIDE) &&
!data->progress.callback)
fprintf(data->set.err, "\n");
data->progress.speeder_c = 0; /* reset the progress meter display */
+ return 0;
}
/* reset all times except redirect, and reset the known transfer sizes */
data->progress.flags &= ~PGRS_UL_SIZE_KNOWN;
}
+/*
+ * Curl_pgrsUpdate() returns 0 for success or the value returned by the
+ * progress callback!
+ */
int Curl_pgrsUpdate(struct connectdata *conn)
{
struct timeval now;
TIMER_LAST /* must be last */
} timerid;
-void Curl_pgrsDone(struct connectdata *);
+int Curl_pgrsDone(struct connectdata *);
void Curl_pgrsStartNow(struct SessionHandle *data);
void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size);
void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size);
if(sftp_scp)
Curl_safefree(sftp_scp->path);
- Curl_pgrsDone(conn);
+ if(Curl_pgrsDone(conn))
+ return CURLE_ABORTED_BY_CALLBACK;
conn->data->req.keepon = 0; /* clear all bits */
return result;
(void)status; /* unused */
(void)premature; /* not used */
- Curl_pgrsDone(conn);
+ if(Curl_pgrsDone(conn))
+ return CURLE_ABORTED_BY_CALLBACK;
/* If we have encountered an error */
code = tftp_translate_code(state->error);
else
result = CURLE_OK;
- Curl_pgrsDone(conn); /* done with the operation */
+ if(Curl_pgrsDone(conn) && !result)
+ result = CURLE_ABORTED_BY_CALLBACK;
/* if the transfer was completed in a paused state there can be buffered
data left to write and then kill */