← Commit list

3b547de301

Stefan Eissing
Stefan Eissing
2026-08-27
SUCCESS Duration: 430s

Subject

imap: APPEND CRLF fix

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/imap.c+8 -3
@@ -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;
}