]> git.ipfire.org Git - pakfire.git/commitdiff
xfer: Ensure we always send the entire buffer
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Feb 2025 19:58:11 +0000 (19:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Feb 2025 19:58:11 +0000 (19:58 +0000)
cURL returns OK even if only parts of the buffer have been sent, so we
need to walk through the loop again to make sure all data is sent.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/xfer.c

index a4b86c421cb0f354ceff1a6d72bc83c88f43d53f..34afc7ca5bf68a52306c377457b4bfa2f681b4a0 100644 (file)
@@ -1694,9 +1694,9 @@ int pakfire_xfer_send_message(struct pakfire_xfer* xfer,
                offset += bytes_sent;
 
                switch (r) {
-                       // All done
+                       // Done, but make sure we have sent the entire buffer
                        case CURLE_OK:
-                               return 0;
+                               continue;
 
                        // We could not send all data, store the message
                        // and wait until the socket is ready