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/01/11 18:17:33 UTC
[5/5] git commit: Applied the patch proposed by Jon (DIRMINA-929)
Updated Branches:
refs/heads/2.0 6982f4114 -> 0627d2545
Applied the patch proposed by Jon (DIRMINA-929)
Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/0627d254
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/0627d254
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/0627d254
Branch: refs/heads/2.0
Commit: 0627d25456216c8efbb8aa3311deea4bbccd3de8
Parents: a9b6446
Author: Emmanuel Lécharny <el...@apache.org>
Authored: Fri Jan 11 18:02:59 2013 +0100
Committer: Emmanuel Lécharny <el...@apache.org>
Committed: Fri Jan 11 18:02:59 2013 +0100
----------------------------------------------------------------------
.../core/polling/AbstractPollingIoProcessor.java | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mina/blob/0627d254/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java b/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java
index 0924f18..5268434 100644
--- a/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java
+++ b/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java
@@ -846,6 +846,7 @@ public abstract class AbstractPollingIoProcessor<S extends AbstractIoSession> im
if ((localWrittenBytes > 0) && ((IoBuffer) message).hasRemaining()) {
// the buffer isn't empty, we re-interest it in writing
+ writtenBytes += localWrittenBytes;
setInterestedInWrite(session, true);
return false;
}
@@ -859,6 +860,7 @@ public abstract class AbstractPollingIoProcessor<S extends AbstractIoSession> im
// return 0 indicating that we need
// to pause until writing may resume.
if ((localWrittenBytes > 0) && (((FileRegion) message).getRemainingBytes() > 0)) {
+ writtenBytes += localWrittenBytes;
setInterestedInWrite(session, true);
return false;
}
@@ -880,6 +882,10 @@ public abstract class AbstractPollingIoProcessor<S extends AbstractIoSession> im
scheduleFlush(session);
return false;
}
+
+ if (message instanceof IoBuffer) {
+ ((IoBuffer) message).free();
+ }
} while (writtenBytes < maxWrittenBytes);
} catch (Exception e) {
if (req != null) {
@@ -913,7 +919,9 @@ public abstract class AbstractPollingIoProcessor<S extends AbstractIoSession> im
} catch (IOException ioe) {
// We have had an issue while trying to send data to the
// peer : let's close the session.
+ buf.free();
session.close(true);
+ return 0;
}
}
@@ -925,8 +933,6 @@ public abstract class AbstractPollingIoProcessor<S extends AbstractIoSession> im
int pos = buf.position();
buf.reset();
- session.increaseScheduledWriteMessages();
-
fireMessageSent(session, req);
// And set it back to its position