mirror of
https://github.com/curl/curl.git
synced 2025-09-25 21:46:48 +03:00
FILE: Fixed sending of data would always return CURLE_WRITE_ERROR
Introduced in commit 2a4ee0d221
sending of data via the FILE
protocol would always return CURLE_WRITE_ERROR regardless of whether
CURL_WRITEFUNC_PAUSE was returned from the callback function or not.
This commit is contained in:
parent
2a4ee0d221
commit
f2d234a4dd
|
@ -444,6 +444,7 @@ CURLcode Curl_client_write(struct connectdata *conn,
|
||||||
wrote = len;
|
wrote = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(CURL_WRITEFUNC_PAUSE == wrote) {
|
||||||
if(conn->handler->flags & PROTOPT_NONETWORK) {
|
if(conn->handler->flags & PROTOPT_NONETWORK) {
|
||||||
/* protocols that work without network cannot be paused. This is
|
/* protocols that work without network cannot be paused. This is
|
||||||
actually only FILE:// just now, and it can't pause since the transfer
|
actually only FILE:// just now, and it can't pause since the transfer
|
||||||
|
@ -451,10 +452,9 @@ CURLcode Curl_client_write(struct connectdata *conn,
|
||||||
failf(data, "Write callback asked for PAUSE when not supported!");
|
failf(data, "Write callback asked for PAUSE when not supported!");
|
||||||
return CURLE_WRITE_ERROR;
|
return CURLE_WRITE_ERROR;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
else if(CURL_WRITEFUNC_PAUSE == wrote)
|
|
||||||
return pausewrite(data, type, ptr, len);
|
return pausewrite(data, type, ptr, len);
|
||||||
|
}
|
||||||
else if(wrote != len) {
|
else if(wrote != len) {
|
||||||
failf(data, "Failed writing body (%zu != %zu)", wrote, len);
|
failf(data, "Failed writing body (%zu != %zu)", wrote, len);
|
||||||
return CURLE_WRITE_ERROR;
|
return CURLE_WRITE_ERROR;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user