You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jk...@apache.org on 2018/01/11 02:14:13 UTC

thrift git commit: THRIFT-4446: JSONProtocol Base64 Encoding: Do not trim padding on encode. Client: csharp Client: netcore

Repository: thrift
Updated Branches:
  refs/heads/master d3355af26 -> d066fa850


THRIFT-4446: JSONProtocol Base64 Encoding: Do not trim padding on encode.
Client: csharp
Client: netcore

This closes #1463


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/d066fa85
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/d066fa85
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/d066fa85

Branch: refs/heads/master
Commit: d066fa850a43859d829ff2f4a1678404cc44596d
Parents: d3355af
Author: Allen Warthen <al...@jhuapl.edu>
Authored: Tue Jan 9 12:04:14 2018 -0500
Committer: James E. King, III <jk...@apache.org>
Committed: Wed Jan 10 21:13:07 2018 -0500

----------------------------------------------------------------------
 lib/csharp/src/Protocol/TJSONProtocol.cs      |  5 -----
 lib/netcore/Thrift/Protocols/TJSONProtocol.cs | 10 +---------
 2 files changed, 1 insertion(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/d066fa85/lib/csharp/src/Protocol/TJSONProtocol.cs
----------------------------------------------------------------------
diff --git a/lib/csharp/src/Protocol/TJSONProtocol.cs b/lib/csharp/src/Protocol/TJSONProtocol.cs
index 5e6589e..0ceb675 100644
--- a/lib/csharp/src/Protocol/TJSONProtocol.cs
+++ b/lib/csharp/src/Protocol/TJSONProtocol.cs
@@ -544,11 +544,6 @@ namespace Thrift.Protocol
             int len = b.Length;
             int off = 0;
 
-            // Ignore padding
-            int bound = len >= 2 ? len - 2 : 0;
-            for (int i = len - 1; i >= bound && b[i] == '='; --i) {
-                --len;
-            }
             while (len >= 3)
             {
                 // Encode 3 bytes at a time

http://git-wip-us.apache.org/repos/asf/thrift/blob/d066fa85/lib/netcore/Thrift/Protocols/TJSONProtocol.cs
----------------------------------------------------------------------
diff --git a/lib/netcore/Thrift/Protocols/TJSONProtocol.cs b/lib/netcore/Thrift/Protocols/TJSONProtocol.cs
index a4ddd5b..17aa5f7 100644
--- a/lib/netcore/Thrift/Protocols/TJSONProtocol.cs
+++ b/lib/netcore/Thrift/Protocols/TJSONProtocol.cs
@@ -384,14 +384,6 @@ namespace Thrift.Protocols
             var len = b.Length;
             var off = 0;
 
-            // Ignore padding
-            var bound = len >= 2 ? len - 2 : 0;
-
-            for (var i = len - 1; i >= bound && b[i] == '='; --i)
-            {
-                --len;
-            }
-
             while (len >= 3)
             {
                 // Encode 3 bytes at a time
@@ -1167,4 +1159,4 @@ namespace Thrift.Protocols
             }
         }
     }
-}
\ No newline at end of file
+}