Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2BAB71851E for ; Wed, 25 Nov 2015 08:28:57 +0000 (UTC) Received: (qmail 42267 invoked by uid 500); 25 Nov 2015 08:28:57 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 42217 invoked by uid 500); 25 Nov 2015 08:28:57 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 42118 invoked by uid 99); 25 Nov 2015 08:28:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Nov 2015 08:28:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 82FDEE03CE; Wed, 25 Nov 2015 08:28:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Wed, 25 Nov 2015 08:28:56 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] ignite git commit: IGNITE-1983 Platforms: fixed a problem with incorrect reader behavior for platform streams. Repository: ignite Updated Branches: refs/heads/ignite-1956 ebf909d93 -> 462f8e618 IGNITE-1983 Platforms: fixed a problem with incorrect reader behavior for platform streams. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c40ab677 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c40ab677 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c40ab677 Branch: refs/heads/ignite-1956 Commit: c40ab677e69f0d756281c62549cb2f63de907ed6 Parents: dafad52 Author: Pavel Tupitsyn Authored: Wed Nov 25 10:14:26 2015 +0300 Committer: vozerov-gridgain Committed: Wed Nov 25 10:14:26 2015 +0300 ---------------------------------------------------------------------- .../internal/portable/BinaryReaderExImpl.java | 18 +++++++++++++++--- .../processors/platform/PlatformContextImpl.java | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/c40ab677/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java index 4809c3c..872d7a3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java @@ -162,6 +162,20 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina */ public BinaryReaderExImpl(PortableContext ctx, PortableInputStream in, ClassLoader ldr, @Nullable BinaryReaderHandles hnds) { + this(ctx, in, ldr, hnds, false); + } + + /** + * Constructor. + * + * @param ctx Context. + * @param in Input stream. + * @param ldr Class loader. + * @param hnds Context. + * @param skipHdrCheck Whether to skip header check. + */ + public BinaryReaderExImpl(PortableContext ctx, PortableInputStream in, ClassLoader ldr, + @Nullable BinaryReaderHandles hnds, boolean skipHdrCheck) { // Initialize base members. this.ctx = ctx; this.in = in; @@ -170,10 +184,8 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina start = in.position(); - byte hdr = in.readByte(); - // Perform full header parsing in case of portable object. - if (hdr == GridPortableMarshaller.OBJ) { + if (!skipHdrCheck && (in.readByte() == GridPortableMarshaller.OBJ)) { // Ensure protocol is fine. PortableUtils.checkProtocolVersion(in.readByte()); http://git-wip-us.apache.org/repos/asf/ignite/blob/c40ab677/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java index 9a7f0df..7db752a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java @@ -177,7 +177,7 @@ public class PlatformContextImpl implements PlatformContext { /** {@inheritDoc} */ @Override public BinaryRawReaderEx reader(PlatformInputStream in) { // TODO: IGNITE-1272 - Is class loader needed here? - return new BinaryReaderExImpl(marsh.context(), in, null); + return new BinaryReaderExImpl(marsh.context(), in, null, null, true); } /** {@inheritDoc} */