Skip to content

Commit e45f13d

Browse files
author
Emile Joubert
committed
Rebase bug21849
1 parent 7a23e88 commit e45f13d

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
@@ -544,9 +544,18 @@ public boolean processControlCommand(Command c)
544544
// See the detailed comments in ChannelN.processAsync.
545545

546546
Method method = c.getMethod();
547-
547+
548548
if (method instanceof AMQP.Connection.Close) {
549-
handleConnectionClose(c);
549+
if (isOpen()) {
550+
handleConnectionClose(c);
551+
} else {
552+
// Already shutting down, so just send back a CloseOk.
553+
try {
554+
_channel0.quiescingTransmit(new AMQImpl.Connection.CloseOk());
555+
} catch (IOException ioe) {
556+
Utility.emptyStatement();
557+
}
558+
}
550559
return true;
551560
} else {
552561
if (isOpen()) {

0 commit comments

Comments
 (0)