qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r667554 - /incubator/qpid/trunk/qpid/cpp/src/qpid/SessionState.cpp
Date Fri, 13 Jun 2008 14:36:53 GMT
Author: aconway
Date: Fri Jun 13 07:36:53 2008
New Revision: 667554

URL: http://svn.apache.org/viewvc?rev=667554&view=rev
Log:
Revert SessionState changes in r667503.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/SessionState.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/SessionState.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/SessionState.cpp?rev=667554&r1=667553&r2=667554&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/SessionState.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/SessionState.cpp Fri Jun 13 07:36:53 2008
@@ -99,8 +99,6 @@
 SessionPoint SessionState::senderGetReplayPoint() const { return sender.replayPoint; }
 
 SessionState::ReplayRange SessionState::senderExpected(const SessionPoint& expect) {
-    if (timeout == 0)
-        return SessionState::ReplayRange();
     if (expect < sender.replayPoint || sender.sendPoint < expect)
         throw InvalidArgumentException(QPID_MSG(getId() << ": expected command-point
out of range."));
     QPID_LOG(debug, getId() << ": sender expected point moved to " << expect);
@@ -116,24 +114,22 @@
     if (isControl(f)) return;   // Ignore control frames.
     QPID_LOG_IF(debug, f.getMethod(), getId() << ": sent cmd " << sender.sendPoint.command
<< ": " << *f.getMethod());
     stateful = true;
-    if (timeout) {
-        sender.replayList.push_back(f);
-        sender.replaySize += f.size();
-        sender.unflushedSize += f.size();
-        if (config.replayHardLimit && config.replayHardLimit < sender.replaySize)

-            throw ResourceLimitExceededException("Replay buffer exceeeded hard limit");
-    }
+    if (timeout) sender.replayList.push_back(f);
+    sender.unflushedSize += f.size();
     sender.bytesSinceKnownCompleted += f.size();
+    sender.replaySize += f.size();
     sender.incomplete += sender.sendPoint.command;
     sender.sendPoint.advance(f);
+    if (config.replayHardLimit && config.replayHardLimit < sender.replaySize)

+        throw ResourceLimitExceededException("Replay buffer exceeeded hard limit");
 }
 
 bool SessionState::senderNeedFlush() const {
-    return timeout != 0 && config.replayFlushLimit && sender.unflushedSize
>= config.replayFlushLimit;
+    return config.replayFlushLimit && sender.unflushedSize >= config.replayFlushLimit;
 }
 
 void SessionState::senderRecordFlush() {
-    if (timeout == 0) return;
+    assert(sender.flushPoint <= sender.sendPoint);
     sender.flushPoint = sender.sendPoint;
     sender.unflushedSize = 0;
 }
@@ -147,7 +143,6 @@
 }
 
 void SessionState::senderConfirmed(const SessionPoint& confirmed) {
-    if (timeout == 0) return;
     if (confirmed > sender.sendPoint)
         throw InvalidArgumentException(QPID_MSG(getId() << "Confirmed commands not
yet sent."));
     QPID_LOG(debug, getId() << ": sender confirmed point moved to " << confirmed);
@@ -163,6 +158,7 @@
     if (sender.replayPoint > sender.flushPoint)
         sender.flushPoint = sender.replayPoint;
     sender.replayList.erase(sender.replayList.begin(), i);
+    assert(sender.replayPoint.offset == 0);
 }
 
 void SessionState::senderCompleted(const SequenceSet& commands) {



Mime
View raw message