From 2fb8bd5f0126ce9a21741a45619a9065433bc949 Mon Sep 17 00:00:00 2001 From: oldrat Date: Fri, 19 Oct 2012 14:54:21 +0800 Subject: [PATCH] reopen http://code.alibabatech.com/jira/browse/DUBBO-600 --- .../com/alibaba/dubbo/remoting/transport/AbstractCodec.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/AbstractCodec.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/AbstractCodec.java index d3026f6cc0c..47f997f6e86 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/AbstractCodec.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/AbstractCodec.java @@ -43,9 +43,9 @@ protected Serialization getSerialization(Channel channel) { protected static void checkPayload(Channel channel, long size) throws IOException { int payload = Constants.DEFAULT_PAYLOAD; if (channel != null && channel.getUrl() != null) { - payload = channel.getUrl().getPositiveParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD); + payload = channel.getUrl().getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD); } - if (size > payload) { + if (payload > 0 && size > payload) { IOException e = new IOException("Data length too large: " + size + ", max payload: " + payload + ", channel: " + channel); logger.error(e); throw e; @@ -75,4 +75,4 @@ protected boolean isServerSide(Channel channel) { return !isClientSide(channel); } -} \ No newline at end of file +}