FILE: we don't support paused transfers using this protocol
Make sure that we detect such attempts and return a proper error code instead of silently handling this in problematic ways. Updated the documentation to mention this limitation. Bug: http://curl.haxx.se/bug/view.cgi?id=1286
This commit is contained in:
12
lib/sendf.c
12
lib/sendf.c
@@ -444,10 +444,18 @@ CURLcode Curl_client_write(struct connectdata *conn,
|
||||
wrote = len;
|
||||
}
|
||||
|
||||
if(CURL_WRITEFUNC_PAUSE == wrote)
|
||||
if(conn->handler->flags & PROTOPT_NONETWORK) {
|
||||
/* protocols that work without network cannot be paused. This is
|
||||
actually only FILE:// just now, and it can't pause since the transfer
|
||||
isn't done using the "normal" procedure. */
|
||||
failf(data, "Write callback asked for PAUSE when not supported!");
|
||||
return CURLE_WRITE_ERROR;
|
||||
}
|
||||
|
||||
else if(CURL_WRITEFUNC_PAUSE == wrote)
|
||||
return pausewrite(data, type, ptr, len);
|
||||
|
||||
if(wrote != len) {
|
||||
else if(wrote != len) {
|
||||
failf(data, "Failed writing body (%zu != %zu)", wrote, len);
|
||||
return CURLE_WRITE_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user