This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch 1.x
in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git

commit 381b114400a7d89c27ea8eba7eda8378a796218e
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Sun May 4 14:31:05 2025 -0400

    Add TODO comment
---
 .../org/apache/commons/fileupload/MultipartStream.java    | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload/MultipartStream.java 
b/src/main/java/org/apache/commons/fileupload/MultipartStream.java
index 4c1e4e21..839efaac 100644
--- a/src/main/java/org/apache/commons/fileupload/MultipartStream.java
+++ b/src/main/java/org/apache/commons/fileupload/MultipartStream.java
@@ -178,8 +178,7 @@ public class MultipartStream {
         /**
          * Closes the input stream.
          *
-         * @param closeUnderlying Whether to close the underlying stream
-         *   (hard close)
+         * @param closeUnderlying Whether to close the underlying stream (hard 
close)
          * @throws IOException An I/O error occurred.
          */
         public void close(final boolean closeUnderlying) throws IOException {
@@ -191,14 +190,16 @@ public class MultipartStream {
                 input.close();
             } else {
                 for (;;) {
-                    int av = available();
-                    if (av == 0) {
-                        av = makeAvailable();
-                        if (av == 0) {
+                    int available = available();
+                    if (available == 0) {
+                        available = makeAvailable();
+                        if (available == 0) {
                             break;
                         }
                     }
-                    skip(av);
+                    if (skip(available) != available) {
+                        // TODO log or throw?
+                    }
                 }
             }
             closed = true;

Reply via email to