You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2019/05/10 20:33:48 UTC

[maven-wagon] branch master updated (35ff402 -> baa6fc2)

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

michaelo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git.


    from 35ff402  Remove getTestRepositoryPort() from WagonTestCase, wagon doesn't always require a port Test with port range for http + ftp server Upgrade maven-enforcer-plugin (defaults is corrupt on one of jenkins-nodes at ASF)
     add 947fa6b  WAGON-557 Wrap around in AbstractWagon.getBufferCapacityForTransfer prevents optimal buffer size selection for large artifacts
     new baa6fc2  [WAGON-557] Integer overflow prevents optimal buffer size selection for large artifacts

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/maven/wagon/AbstractWagon.java | 12 ++++++++----
 .../java/org/apache/maven/wagon/AbstractWagonTest.java  | 17 +++++++++++++++++
 2 files changed, 25 insertions(+), 4 deletions(-)


[maven-wagon] 01/01: [WAGON-557] Integer overflow prevents optimal buffer size selection for large artifacts

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git

commit baa6fc226374303e86902b82901cf8a9f71eba3a
Author: olaf.otto <ol...@unic.com>
AuthorDate: Thu May 9 17:08:15 2019 +0200

    [WAGON-557] Integer overflow prevents optimal buffer size selection for large artifacts
    
    This closes #54
---
 .../java/org/apache/maven/wagon/AbstractWagonTest.java  | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/wagon-provider-api/src/test/java/org/apache/maven/wagon/AbstractWagonTest.java b/wagon-provider-api/src/test/java/org/apache/maven/wagon/AbstractWagonTest.java
index ac2e6f6..81b07db 100644
--- a/wagon-provider-api/src/test/java/org/apache/maven/wagon/AbstractWagonTest.java
+++ b/wagon-provider-api/src/test/java/org/apache/maven/wagon/AbstractWagonTest.java
@@ -117,6 +117,23 @@ public class AbstractWagonTest
 
     }
 
+    public void testCalculationOfTransferBufferSize() {
+        // 1 KiB -> Default buffer size (4 KiB)
+        assertEquals( 4096, wagon.getBufferCapacityForTransfer(1024L ) );
+
+        // 1 MiB -> Twice the default buffer size (8 KiB)
+        assertEquals( 4096 * 2, wagon.getBufferCapacityForTransfer(1024L * 1024 ) );
+
+        // 100 MiB -> Maximum buffer size (512 KiB)
+        assertEquals( 4096 * 128, wagon.getBufferCapacityForTransfer(1024L * 1024  * 100 ) );
+
+        // 1 GiB -> Maximum buffer size (512 KiB)
+        assertEquals( 4096 * 128, wagon.getBufferCapacityForTransfer(1024L * 1024  * 1024 ) );
+
+        // 100 GiB -> Maximum buffer size (512 KiB)
+        assertEquals( 4096 * 128, wagon.getBufferCapacityForTransfer(1024L * 1024  * 1024 * 100 ) );
+    }
+
     public void testSessionListenerRegistration()
     {
         assertTrue( wagon.hasSessionListener( sessionListener ) );