struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbened...@apache.org
Subject svn commit: r553322 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java
Date Wed, 04 Jul 2007 20:13:40 GMT
Author: pbenedict
Date: Wed Jul  4 13:13:39 2007
New Revision: 553322

URL: http://svn.apache.org/viewvc?view=rev&rev=553322
Log:
STR-2700: Narrow the stream clearing to Windows only

Modified:
    struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java

Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java?view=diff&rev=553322&r1=553321&r2=553322
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java
(original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java
Wed Jul  4 13:13:39 2007
@@ -275,12 +275,14 @@
      */
     protected void clearInputStream(HttpServletRequest request) {
         try {
-            ServletInputStream is = request.getInputStream();
-            byte[] data = new byte[DEFAULT_SIZE_THRESHOLD];
-            int bytesRead = 0;
-            do {
-                bytesRead = is.read(data);
-            } while (bytesRead > -1);
+            if (System.getProperty("os.name").contains("Windows")) {
+                ServletInputStream is = request.getInputStream();
+                byte[] data = new byte[DEFAULT_SIZE_THRESHOLD];
+                int bytesRead = 0;
+                do {
+                    bytesRead = is.read(data);
+                } while (bytesRead > -1);
+            }   
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }



Mime
View raw message