summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/AsynchIOHandler.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2013-06-04 14:27:55 +0000
committerAndrew Stitcher <astitcher@apache.org>2013-06-04 14:27:55 +0000
commit42cdb01aadb1c17aa786edbf24f6a046a0844857 (patch)
tree3c95ed435fca3589df4297f9495a3ba3a1b98bbd /cpp/src/qpid/sys/AsynchIOHandler.cpp
parent69aed09e38db75ccdd89c2146c066e60a6ab1011 (diff)
downloadqpid-python-42cdb01aadb1c17aa786edbf24f6a046a0844857.tar.gz
QPID-4854: Make the protocol negotiation timeout actually relate to
the protocol negotiation! git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1489458 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/AsynchIOHandler.cpp')
-rw-r--r--cpp/src/qpid/sys/AsynchIOHandler.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/cpp/src/qpid/sys/AsynchIOHandler.cpp b/cpp/src/qpid/sys/AsynchIOHandler.cpp
index cf08b482e6..f102807b5b 100644
--- a/cpp/src/qpid/sys/AsynchIOHandler.cpp
+++ b/cpp/src/qpid/sys/AsynchIOHandler.cpp
@@ -100,6 +100,13 @@ void AsynchIOHandler::abort() {
aio->queueWriteClose();
}
+void AsynchIOHandler::connectionEstablished() {
+ if (timeoutTimerTask) {
+ timeoutTimerTask->cancel();
+ timeoutTimerTask.reset();
+ }
+}
+
void AsynchIOHandler::activateOutput() {
aio->notifyPendingWrite();
}
@@ -123,13 +130,6 @@ void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) {
if (codec) { // Already initiated
try {
decoded = codec->decode(buff->bytes+buff->dataStart, buff->dataCount);
- // When we've decoded 3 reads (probably frames) we will have authenticated and
- // started heartbeats, if specified, in many (but not all) cases so now we will cancel
- // the idle connection timeout - this is really hacky, and would be better implemented
- // in the connection, but that isn't actually created until the first decode.
- if (reads == 3) {
- timeoutTimerTask->cancel();
- }
}catch(const std::exception& e){
QPID_LOG(error, e.what());
readError = true;
@@ -203,10 +203,6 @@ void AsynchIOHandler::idle(AsynchIO&){
if (isClient && codec == 0) {
codec = factory->create(*this, identifier, getSecuritySettings(aio, nodict));
write(framing::ProtocolInitiation(codec->getVersion()));
- // We've just sent the protocol negotiation so we can cancel the timeout for that
- // This is not ideal, because we've not received anything yet, but heartbeats will
- // be active soon
- timeoutTimerTask->cancel();
return;
}
if (codec == 0) return;