diff options
Diffstat (limited to 'cpp/lib/broker/SessionHandlerImpl.cpp')
-rw-r--r-- | cpp/lib/broker/SessionHandlerImpl.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/lib/broker/SessionHandlerImpl.cpp b/cpp/lib/broker/SessionHandlerImpl.cpp index 26cdfebad2..25f3fbc10f 100644 --- a/cpp/lib/broker/SessionHandlerImpl.cpp +++ b/cpp/lib/broker/SessionHandlerImpl.cpp @@ -222,9 +222,15 @@ void SessionHandlerImpl::ConnectionHandlerImpl::closeOk(u_int16_t /*channel*/){ void SessionHandlerImpl::ChannelHandlerImpl::open(u_int16_t channel, const string& /*outOfBand*/){ - parent->channels[channel] = new Channel(parent->client->getProtocolVersion() , parent->context, channel, parent->framemax, - parent->queues->getStore(), parent->settings.stagingThreshold); - parent->client->getChannel().openOk(channel); + if (parent->channels[channel] == 0) { + parent->channels[channel] = new Channel(parent->client->getProtocolVersion() , parent->context, channel, parent->framemax, + parent->queues->getStore(), parent->settings.stagingThreshold); + parent->client->getChannel().openOk(channel); + } else { + std::stringstream out; + out << "Channel already open: " << channel; + throw ConnectionException(504, out.str()); + } } void SessionHandlerImpl::ChannelHandlerImpl::flow(u_int16_t /*channel*/, bool /*active*/){} |