summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2014-01-23 03:09:28 +0000
committerAndrew Stitcher <astitcher@apache.org>2014-01-23 03:09:28 +0000
commita9e08be8975a405bc5f005a6af81297a174b8eb4 (patch)
tree9d5bc2f228e2c77345cc9744c9f67c5c634cec56 /cpp
parentb9ce667cf8953e7ac65d9eaac88c27ba473529fe (diff)
downloadqpid-python-a9e08be8975a405bc5f005a6af81297a174b8eb4.tar.gz
QPID-5488: Allow for not enough bytes initially received by client for protocol init
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1560575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/client/SslConnector.cpp4
-rw-r--r--cpp/src/qpid/client/TCPConnector.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/SslConnector.cpp b/cpp/src/qpid/client/SslConnector.cpp
index 2e8842f24b..b292c0e6d6 100644
--- a/cpp/src/qpid/client/SslConnector.cpp
+++ b/cpp/src/qpid/client/SslConnector.cpp
@@ -359,8 +359,10 @@ size_t SslConnector::decode(const char* buffer, size_t size)
throw Exception(QPID_MSG("Unsupported version: " << protocolInit
<< " supported version " << version));
}
+ initiated = true;
+ } else {
+ return size - in.available();
}
- initiated = true;
}
AMQFrame frame;
while(frame.decode(in)){
diff --git a/cpp/src/qpid/client/TCPConnector.cpp b/cpp/src/qpid/client/TCPConnector.cpp
index 2bdeec5b47..02f820fe03 100644
--- a/cpp/src/qpid/client/TCPConnector.cpp
+++ b/cpp/src/qpid/client/TCPConnector.cpp
@@ -289,8 +289,10 @@ size_t TCPConnector::decode(const char* buffer, size_t size)
throw Exception(QPID_MSG("Unsupported version: " << protocolInit
<< " supported version " << version));
}
+ initiated = true;
+ } else {
+ return size - in.available();
}
- initiated = true;
}
AMQFrame frame;
while(frame.decode(in)){