Skip to content

Commit 5393e4f

Browse files
author
Simon MacMullen
committed
Merged bug 21849.
2 parents dc88e27 + 6903f4e commit 5393e4f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/com/rabbitmq/client/impl/AMQConnection.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,18 @@ public boolean processControlCommand(Command c)
528528
// See the detailed comments in ChannelN.processAsync.
529529

530530
Method method = c.getMethod();
531-
531+
532532
if (method instanceof AMQP.Connection.Close) {
533-
handleConnectionClose(c);
533+
if (isOpen()) {
534+
handleConnectionClose(c);
535+
} else {
536+
// Already shutting down, so just send back a CloseOk.
537+
try {
538+
_channel0.quiescingTransmit(new AMQImpl.Connection.CloseOk());
539+
} catch (IOException ioe) {
540+
Utility.emptyStatement();
541+
}
542+
}
534543
return true;
535544
} else {
536545
if (isOpen()) {

0 commit comments

Comments
 (0)