only attempt to close socket if its open
On socket errors we always close the socket per amqp specification, however there is no need to do so if the connection has already been forcibly closed from the server side. This causes recursive loops when using SSL connections
This commit is contained in:
parent
6cc9ee7457
commit
9b3288ca9d
|
|
@ -193,8 +193,13 @@ void QAmqpClientPrivate::_q_socketError(QAbstractSocket::SocketError error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// per spec, on any error we need to close the socket immediately
|
// per spec, on any error we need to close the socket immediately
|
||||||
// and send no more data;
|
// and send no more data. only try to send the close message if we
|
||||||
socket->close();
|
// are actively connected
|
||||||
|
if (socket->state() == QAbstractSocket::ConnectedState ||
|
||||||
|
socket->state() == QAbstractSocket::ConnectingState) {
|
||||||
|
socket->abort();
|
||||||
|
}
|
||||||
|
|
||||||
errorString = socket->errorString();
|
errorString = socket->errorString();
|
||||||
|
|
||||||
if (autoReconnect) {
|
if (autoReconnect) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue