mirror of
https://github.com/curl/curl.git
synced 2026-07-24 17:07:16 +03:00
urldata: simplify bytecounters
- no need to have them protocol specific - no need to set pointers to them with the Curl_setup_transfer() call - make Curl_setup_transfer() operate on a transfer pointer, not connection - switch some counters from long to the more proper curl_off_t type Closes #3627
This commit is contained in:
parent
8cf6c170cf
commit
65eb65fde6
22 changed files with 111 additions and 176 deletions
|
|
@ -1200,7 +1200,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||
Curl_pgrsSetUploadSize(data, data->state.infilesize);
|
||||
}
|
||||
/* upload data */
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL);
|
||||
Curl_setup_transfer(data, -1, -1, FALSE, FIRSTSOCKET);
|
||||
|
||||
/* not set by Curl_setup_transfer to preserve keepon bits */
|
||||
conn->sockfd = conn->writesockfd;
|
||||
|
|
@ -1462,7 +1462,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||
sshc->sftp_dir = NULL;
|
||||
|
||||
/* no data to transfer */
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(data, -1, -1, FALSE, -1);
|
||||
state(conn, SSH_STOP);
|
||||
break;
|
||||
|
||||
|
|
@ -1603,13 +1603,12 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||
/* Setup the actual download */
|
||||
if(data->req.size == 0) {
|
||||
/* no data to transfer */
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(data, -1, -1, FALSE, -1);
|
||||
infof(data, "File already completely downloaded\n");
|
||||
state(conn, SSH_STOP);
|
||||
break;
|
||||
}
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, data->req.size,
|
||||
FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(data, FIRSTSOCKET, data->req.size, FALSE, -1);
|
||||
|
||||
/* not set by Curl_setup_transfer to preserve keepon bits */
|
||||
conn->writesockfd = conn->sockfd;
|
||||
|
|
@ -1731,8 +1730,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||
}
|
||||
|
||||
/* upload data */
|
||||
Curl_setup_transfer(conn, -1, data->req.size, FALSE, NULL,
|
||||
FIRSTSOCKET, NULL);
|
||||
Curl_setup_transfer(data, -1, data->req.size, FALSE, FIRSTSOCKET);
|
||||
|
||||
/* not set by Curl_setup_transfer to preserve keepon bits */
|
||||
conn->sockfd = conn->writesockfd;
|
||||
|
|
@ -1775,8 +1773,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||
/* download data */
|
||||
bytecount = ssh_scp_request_get_size(sshc->scp_session);
|
||||
data->req.maxdownload = (curl_off_t) bytecount;
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, bytecount, FALSE, NULL, -1,
|
||||
NULL);
|
||||
Curl_setup_transfer(data, FIRSTSOCKET, bytecount, FALSE, -1);
|
||||
|
||||
/* not set by Curl_setup_transfer to preserve keepon bits */
|
||||
conn->writesockfd = conn->sockfd;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue