]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
bufq: writing into a softlimit queue cannot be partial
authorStefan Eissing <stefan@eissing.org>
Fri, 1 Mar 2024 08:12:50 +0000 (09:12 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 3 Mar 2024 16:35:47 +0000 (17:35 +0100)
- when unable to obtain a new chunk on a softlimit bufq,
  this is an allocation error and needs to be reported as
  such.
- writes into a soflimit bufq never must be partial success

Reported-by: Dan Fandrich
Fixes #13020
Closes #13023

lib/bufq.c

index 4369fe0b268aeb296b00373f57ad3b0cc69c91f1..c3245516c9fce016866d3f3bd96ee495de0d415b 100644 (file)
@@ -396,7 +396,7 @@ ssize_t Curl_bufq_write(struct bufq *q,
   while(len) {
     tail = get_non_full_tail(q);
     if(!tail) {
-      if(q->chunk_count < q->max_chunks) {
+      if((q->chunk_count < q->max_chunks) || (q->opts & BUFQ_OPT_SOFT_LIMIT)) {
         *err = CURLE_OUT_OF_MEMORY;
         return -1;
       }