You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2018/03/21 19:01:06 UTC

[cxf] branch 3.1.x-fixes updated (1146722 -> 4282054)

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

dkulp pushed a change to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 1146722  Fixing SwaggerToOpenApiConversionUtils against recent OpenApi 3.0.1
     new 4d50912  [CXF-7684] Fix problem of attachement blocks not divisible by 3
     new 4282054  Recording .gitmergeinfo Changes

The 2 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:
 .gitmergeinfo                                      |  4 +++
 .../cxf/attachment/AttachmentSerializer.java       | 29 ++++++++++++++++++----
 2 files changed, 28 insertions(+), 5 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
dkulp@apache.org.

[cxf] 01/02: [CXF-7684] Fix problem of attachement blocks not divisible by 3

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

dkulp pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 4d5091241093301c2402e728c843641c8c8b344f
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Wed Mar 21 14:59:14 2018 -0400

    [CXF-7684] Fix problem of attachement blocks not divisible by 3
    
    (cherry picked from commit ca72cc5f5746e0fd620d85cc56b14f1f4df424ca)
---
 .../cxf/attachment/AttachmentSerializer.java       | 29 ++++++++++++++++++----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
index 66e7b28..36367fa 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
@@ -296,8 +296,9 @@ public class AttachmentSerializer {
 
     private int encodeBase64(InputStream input, OutputStream output, int bufferSize) throws IOException {
         int avail = input.available();
-        if (avail > 262144) {
-            avail = 262144;
+        if (avail > 262143) {
+            //must be divisible by 3
+            avail = 262143;
         }
         if (avail > bufferSize) {
             bufferSize = avail;
@@ -306,13 +307,31 @@ public class AttachmentSerializer {
         int n = 0;
         n = input.read(buffer);
         int total = 0;
+        int left = 0;
         while (-1 != n) {
             if (n == 0) {
                 throw new IOException("0 bytes read in violation of InputStream.read(byte[])");
             }
-            Base64Utility.encodeAndStream(buffer, 0, n, output);
-            total += n;
-            n = input.read(buffer);
+            //make sure n is divisible by 3
+            left = n % 3;
+            n -= left;
+            if (n > 0) {
+                Base64Utility.encodeAndStream(buffer, 0, n, output);
+                total += n;
+            }
+            if (left != 0) {
+                for (int x = 0; x < left; ++x) {
+                    buffer[x] = buffer[n + x];
+                }
+                n = input.read(buffer, left, buffer.length - left);
+                if (n == -1) {
+                    // we've hit the end, but still have stuff left, write it out
+                    Base64Utility.encodeAndStream(buffer, 0, left, output);
+                    total += left;
+                }
+            } else {
+                n = input.read(buffer);
+            }
         }
         return total;
     }

-- 
To stop receiving notification emails like this one, please contact
dkulp@apache.org.

[cxf] 02/02: Recording .gitmergeinfo Changes

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

dkulp pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 428205428ee6d8c44b99da408e848a7509f71746
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Wed Mar 21 15:01:03 2018 -0400

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index cba56e8..1f1b9a6 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -112,6 +112,7 @@ B 1eedb232f7f97f5d8cb3a8ab4dcd67251e073ec1
 B 1f68d848874bc2be86d3e77e408f0b9879c1e93c
 B 1f7241ba6017f1496e9b8aadec5c807ed05e63b4
 B 1f9601c248b4260f2fd5fd27c3d6b0ab868f5a24
+B 1fc1fa0c7977b5cc69d5ea7ff33369583c4ac6d8
 B 1fd95a5baa28b009491fd575db8f5d01d11ddfed
 B 201f4a681622767e6e199ba2ee364731bcdc05f6
 B 203b5433bc44aa831bdd9b1dd4ab474d192dea6c
@@ -266,6 +267,7 @@ B 52bbb4bfdbae96c93693191c850db12e6f5f21e8
 B 52ccbfa5e9fe59662eb8e534c79d4cd48a370703
 B 53736b8c3d41d2f96c61b2ab9aa4ab5250b1e7ed
 B 53a46205871434d8c47ed45822e078e5ad6d2c60
+B 53b2be829ed6cd7660ae90e035cc8588b0a8dfb1
 B 53f738a2cacf205b0221f03bd9579e9891708c69
 B 540a1255be34c047c094f53461925d46c3ed058b
 B 54910695917fb63a11982a8dc96a3b4d088963c5
@@ -383,6 +385,7 @@ B 77c3f51dcb1f02c8799f4e09676c0697e76a0756
 B 77e0ffed1a647a159d7b249071de87c049803885
 B 782cd824775c353c034d10821b271da2ecf50e13
 B 78391d887bba28d6224bda6fe72d4be2fb63fac9
+B 786014228043dfb17bcf57e56d6f2a87d1950abe
 B 79244372958dc1a9e382db4e1740e248bc8e2538
 B 7974c5c33b3f92b046f0c50f798f9bc9b711422c
 B 79b00e8ff8584f431df4311b614ed843feea1f04
@@ -549,6 +552,7 @@ B b69bd427318a9f6db6e6e7940796cb233aa54ef9
 B b6a4763dc95c874004e600c78888796474f267b8
 B b7cd2fb4b883cf9f6972d3593ecb0e1d31be7245
 B b8132e5962e326355b699bca445afe9274d0f91d
+B b82303bfb6802817d3ce3be1ce30df74fee50675
 B b9191338ff4c00d36251adc352677212b0d6d7d0
 B b936edac5170d959fc1b17550d3b83f3a1f5fbdc
 B b9df4f5bad7ae1ecee86757c73c0f0fa4bc21de0

-- 
To stop receiving notification emails like this one, please contact
dkulp@apache.org.