Increment nextChannelNumber only once

nextChannelNumber is being incremented twice. When the counter wraps
around it starts declaring already existing channels and the AMQP server
disconnects the client. This patch doubles the number of channels that
can be created before this happens.
This commit is contained in:
Marcelo E. Magallon 2015-02-11 15:11:33 -06:00
parent 79226ccb35
commit 2652206d18
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ void QAmqpChannelPrivate::init(int channel, QAmqpClient *c)
client = c;
needOpen = channel == -1 ? true : false;
channelNumber = channel == -1 ? ++nextChannelNumber : channel;
nextChannelNumber = qMax(channelNumber, (nextChannelNumber + 1));
nextChannelNumber = qMax(channelNumber, nextChannelNumber);
}
bool QAmqpChannelPrivate::_q_method(const QAmqpMethodFrame &frame)