diff options
author | Gordon Sim <gsim@apache.org> | 2008-03-31 10:44:10 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-03-31 10:44:10 +0000 |
commit | 4c0600f324a10a59cf505b991e687d9888fa3a16 (patch) | |
tree | 5812ac4e3bb0b37321af2a599e936b779c65ec73 /cpp/src | |
parent | 10253f694e4ad13ea4aff59ae712513b34d789b6 (diff) | |
download | qpid-python-4c0600f324a10a59cf505b991e687d9888fa3a16.tar.gz |
Prevent broker exit on receiving connection with invalid protocol version.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@642959 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/sys/AsynchIOAcceptor.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpp/src/qpid/sys/AsynchIOAcceptor.cpp b/cpp/src/qpid/sys/AsynchIOAcceptor.cpp index f74541d29a..6502885ed0 100644 --- a/cpp/src/qpid/sys/AsynchIOAcceptor.cpp +++ b/cpp/src/qpid/sys/AsynchIOAcceptor.cpp @@ -27,6 +27,7 @@ #include "Thread.h" #include "qpid/sys/ConnectionOutputHandler.h" +#include "qpid/framing/AMQP_HighestVersion.h" #include "qpid/framing/reply_exceptions.h" #include "qpid/framing/ProtocolInitiation.h" #include "qpid/log/Statement.h" @@ -247,10 +248,11 @@ void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) { QPID_LOG(debug, "RECV [" << identifier << "] INIT(" << protocolInit << ")"); codec = factory->create(protocolInit.getVersion(), *this, identifier); if (!codec) { - // FIXME aconway 2008-03-18: send valid version header & close connection. - // FIXME aconway 2008-03-18: exception type - throw Exception( - QPID_MSG("Protocol version not supported: " << protocolInit)); + //TODO: may still want to revise this... + //send valid version header & close connection. + write(framing::ProtocolInitiation(framing::highestProtocolVersion)); + readError = true; + aio->queueWriteClose(); } } } |