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:
parent
79226ccb35
commit
2652206d18
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue