archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r919313 - in /archiva/branches/archiva-1.3.x: ./ archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ archiva-modules/archiva-web/archiva-webapp-test/ archiva-modules/archiva-...
Date Fri, 05 Mar 2010 06:42:52 GMT
Author: brett
Date: Fri Mar  5 06:42:52 2010
New Revision: 919313

URL: http://svn.apache.org/viewvc?rev=919313&view=rev
Log:
[MRM-1356] handle chunked / unknown length requests correctly
Merged from: r919307

Modified:
    archiva/branches/archiva-1.3.x/   (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java
  (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/   (props
changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties
  (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml
  (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/security/UserRepositoriesStub.java
  (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/
  (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java
  (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/
  (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.xml
  (props changed)
    archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java

Propchange: archiva/branches/archiva-1.3.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements:723609-726925
 /archiva/branches/archiva-struts2:699795-705848
 /archiva/tags/archiva-1.3:898632
-/archiva/trunk:900342,909454-909456,917398,917519
+/archiva/trunk:900342,909454-909456,917398,917519,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/BaseConsumer.java:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:898632
-/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:900342,909454-909456,917398,917519
+/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:900342,909454-909456,917398,917519,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp-test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp-test:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp-test:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp-test:898632
-/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test:900342,909454-909456,915192-918810
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-test:900342,909454-909456,915192-918810,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties:898632
-/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties:900342,909454-909456,917398,917519
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.properties:900342,909454-909456,917398,917519,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml:898632
-/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml:900342,909454-909456,917398,917519
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml:900342,909454-909456,917398,917519,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/security/UserRepositoriesStub.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/UserRepositoriesStub.java:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/UserRepositoriesStub.java:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/security/UserRepositoriesStub.java:898632
-/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/security/UserRepositoriesStub.java:900342,909454-909456,917398,917519
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/security/UserRepositoriesStub.java:900342,909454-909456,917398,917519,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports:898632*
-/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports:900342,909454-909456,917398,917519
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports:900342,909454-909456,917398,917519,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java:898632
-/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java:900342,909454-909456,917398,917519
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java:900342,909454-909456,917398,917519,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports:898632*
-/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports:900342,909454-909456,917398,917519
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports:900342,909454-909456,917398,917519,919307

Propchange: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  5 06:42:52 2010
@@ -3,4 +3,4 @@
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.xml:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.xml:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.xml:898632
-/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.xml:900342,909454-909456,917398,917519
+/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.xml:900342,909454-909456,917398,917519,919307

Modified: archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java?rev=919313&r1=919312&r2=919313&view=diff
==============================================================================
--- archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
(original)
+++ archiva/branches/archiva-1.3.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
Fri Mar  5 06:42:52 2010
@@ -310,13 +310,16 @@
             }
 
             // TODO: a bad deployment shouldn't delete an existing file - do we need to write
to a temporary location first?
-            if ( inputContext.getContentLength() != localFile.length() )
+            long expectedContentLength = inputContext.getContentLength();
+            long actualContentLength = localFile.length();
+            // length of -1 is given for a chunked request or unknown length, in which case
we accept what was uploaded
+            if ( expectedContentLength >= 0 && expectedContentLength != actualContentLength
)
             {
-                FileUtils.deleteQuietly( localFile );
-
                 String msg =
-                    "Content Header length was " + inputContext.getContentLength() + " but
was " + localFile.length();
+                    "Content Header length was " + expectedContentLength + " but was " +
actualContentLength;
                 log.debug( "Upload failed: " + msg );
+
+                FileUtils.deleteQuietly( localFile );
                 throw new DavException( HttpServletResponse.SC_BAD_REQUEST, msg );
             }
 



Mime
View raw message