You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2013/04/11 00:40:46 UTC
[1/2] git commit: Apply the DIRMINA-933 patch
Updated Branches:
refs/heads/2.0 1c0b3f1b7 -> 597221e00
Apply the DIRMINA-933 patch
Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/9b5bcaa5
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/9b5bcaa5
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/9b5bcaa5
Branch: refs/heads/2.0
Commit: 9b5bcaa5756c13f9f0872cccf623707801e11ab4
Parents: 2c1bf39
Author: Emmanuel Lécharny <el...@apache.org>
Authored: Thu Apr 11 00:15:31 2013 +0200
Committer: Emmanuel Lécharny <el...@apache.org>
Committed: Thu Apr 11 00:15:31 2013 +0200
----------------------------------------------------------------------
.../org/apache/mina/http/HttpServerDecoder.java | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mina/blob/9b5bcaa5/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java
----------------------------------------------------------------------
diff --git a/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java b/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java
index e9d09b8..61c1933 100644
--- a/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java
+++ b/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java
@@ -71,7 +71,7 @@ public class HttpServerDecoder implements ProtocolDecoder {
/** Regex to split cookie header following RFC6265 Section 5.4 */
public static final Pattern COOKIE_SEPARATOR_PATTERN = Pattern.compile(";");
- public void decode(final IoSession session, final IoBuffer msg, final ProtocolDecoderOutput out) {
+ public void decode(IoSession session, IoBuffer msg, ProtocolDecoderOutput out) {
DecoderState state = (DecoderState) session.getAttribute(DECODER_STATE_ATT);
if (null == state) {
session.setAttribute(DECODER_STATE_ATT, DecoderState.NEW);
@@ -85,37 +85,38 @@ public class HttpServerDecoder implements ProtocolDecoder {
// concat the old buffer and the new incoming one
IoBuffer.allocate(oldBuffer.remaining() + msg.remaining()).put(oldBuffer).put(msg).flip();
// now let's decode like it was a new message
-
+ msg = IoBuffer.allocate(oldBuffer.remaining() + msg.remaining()).put(oldBuffer).put(msg).flip();
case NEW:
LOG.debug("decoding NEW");
- final HttpRequestImpl rq = parseHttpRequestHead(msg.buf());
+ HttpRequestImpl rq = parseHttpRequestHead(msg.buf());
if (rq == null) {
// we copy the incoming BB because it's going to be recycled by the inner IoProcessor for next reads
- final ByteBuffer partial = ByteBuffer.allocate(msg.remaining());
+ ByteBuffer partial = ByteBuffer.allocate(msg.remaining());
partial.put(msg.buf());
partial.flip();
// no request decoded, we accumulate
session.setAttribute(PARTIAL_HEAD_ATT, partial);
session.setAttribute(DECODER_STATE_ATT, DecoderState.HEAD);
+ break;
} else {
out.write(rq);
// is it a request with some body content ?
- final String contentLen = rq.getHeader("content-length");
+ String contentLen = rq.getHeader("content-length");
if (contentLen != null) {
LOG.debug("found content len : {}", contentLen);
session.setAttribute(BODY_REMAINING_BYTES, Integer.valueOf(contentLen));
session.setAttribute(DECODER_STATE_ATT, DecoderState.BODY);
+ // fallthrough, process body immediately
} else {
LOG.debug("request without content");
session.setAttribute(DECODER_STATE_ATT, DecoderState.NEW);
out.write(new HttpEndOfContent());
+ break;
}
}
- break;
-
case BODY:
LOG.debug("decoding BODY: {} bytes", msg.remaining());
final int chunkSize = msg.remaining();
[2/2] git commit: Merge branch '2.0' of
https://git-wip-us.apache.org/repos/asf/mina into 2.0
Posted by el...@apache.org.
Merge branch '2.0' of https://git-wip-us.apache.org/repos/asf/mina into 2.0
Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/597221e0
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/597221e0
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/597221e0
Branch: refs/heads/2.0
Commit: 597221e00031b82a5d25c644db68895e746e39bd
Parents: 9b5bcaa 1c0b3f1
Author: Emmanuel Lécharny <el...@apache.org>
Authored: Thu Apr 11 00:40:29 2013 +0200
Committer: Emmanuel Lécharny <el...@apache.org>
Committed: Thu Apr 11 00:40:29 2013 +0200
----------------------------------------------------------------------
.../apache/mina/filter/ssl/SslDIRMINA937Test.java | 170 +++++++++++++++
1 files changed, 170 insertions(+), 0 deletions(-)
----------------------------------------------------------------------