imap: APPEND CRLF fix
No binary (build failed)
—
(log yok)
| @@ -886,7 +886,6 @@ static CURLcode imap_perform_append(struct Curl_easy *data, | |
| result = Curl_creader_set_mime(data, postp); | |
| if(result) | |
| return result; | |
| - | data->state.infilesize = Curl_creader_client_length(data); |
| } | |
| else | |
| #endif | |
| @@ -896,9 +895,15 @@ static CURLcode imap_perform_append(struct Curl_easy *data, | |
| return result; | |
| } | |
| - | /* Check we know the size of the upload */ |
| + | /* Check we know the size of the upload. This takes all readers |
| + | * into account. Especially crlf conversions which make the size |
| + | * unpredictable, e.g. -1. */ |
| + | data->state.infilesize = Curl_creader_total_length(data); |
| if(data->state.infilesize < 0) { | |
| - | failf(data, "Cannot APPEND with unknown input file size"); |
| + | if(data->set.crlf) |
| + | failf(data, "Cannot APPEND with CRLF conversion making size unknown"); |
| + | else |
| + | failf(data, "Cannot APPEND with unknown input file size"); |
| return CURLE_UPLOAD_FAILED; | |
| } | |