Skip to content

Commit a456b7d

Browse files
author
Matthias Radestock
committed
merge bug19497 into default
2 parents c4f0019 + 774e215 commit a456b7d

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,22 @@ public void releaseChannelNumber() {
172172
// incoming commands except for a close-ok.
173173

174174
Method method = command.getMethod();
175+
176+
if (method instanceof Channel.Close) {
177+
// Channel should always respond to Channel.Close
178+
// from the server
179+
releaseChannelNumber();
180+
ShutdownSignalException signal = new ShutdownSignalException(false,
181+
false,
182+
command,
183+
this);
184+
synchronized(this) {
185+
processShutdownSignal(signal, true, true);
186+
quiescingTransmit(new Channel.CloseOk());
187+
}
188+
notifyListeners();
189+
return true;
190+
}
175191
if (isOpen()) {
176192
// We're in normal running mode.
177193

@@ -219,18 +235,6 @@ public void releaseChannelNumber() {
219235
}
220236
}
221237
return true;
222-
} else if (method instanceof Channel.Close) {
223-
releaseChannelNumber();
224-
ShutdownSignalException signal = new ShutdownSignalException(false,
225-
false,
226-
command,
227-
this);
228-
synchronized(this) {
229-
processShutdownSignal(signal, true, true);
230-
quiescingTransmit(new Channel.CloseOk());
231-
}
232-
notifyListeners();
233-
return true;
234238
} else {
235239
return false;
236240
}

0 commit comments

Comments
 (0)