Skip to content

Commit 8b4fe69

Browse files
author
Alexandru Scvortov
committed
nacksReceived -> onlyAcksReceived
1 parent 1e8bb82 commit 8b4fe69

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel
111111

112112
/** Whether any nacks have been received since the last
113113
* waitForConfirms(). */
114-
protected volatile boolean nacksReceived = false;
114+
protected volatile boolean onlyAcksReceived = true;
115115

116116
/**
117117
* Construct a new channel on the given connection with the given
@@ -196,9 +196,9 @@ public boolean waitForConfirms()
196196
throw new IOException(Utility.fixStackTrace(getCloseReason()));
197197
}
198198
if (unconfirmedSet.isEmpty()) {
199-
boolean noNacksReceived = !nacksReceived;
200-
nacksReceived = false;
201-
return noNacksReceived;
199+
boolean aux = onlyAcksReceived;
200+
onlyAcksReceived = true;
201+
return aux;
202202
}
203203
unconfirmedSet.wait();
204204
}
@@ -988,7 +988,7 @@ protected void handleAckNack(long seqNo, boolean multiple, boolean nack) {
988988
unconfirmedSet.remove(seqNo);
989989
}
990990
synchronized (unconfirmedSet) {
991-
nacksReceived = nacksReceived || nack;
991+
onlyAcksReceived = onlyAcksReceived && !nack;
992992
if (unconfirmedSet.isEmpty())
993993
unconfirmedSet.notify();
994994
}

0 commit comments

Comments
 (0)