Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.eclipse.paho.mqttv5.common.MqttException;
import org.eclipse.paho.mqttv5.common.MqttMessage;
import org.eclipse.paho.mqttv5.common.MqttPersistenceException;
import org.eclipse.paho.mqttv5.common.packet.MqttAuth;
import org.eclipse.paho.mqttv5.common.packet.MqttConnAck;
import org.eclipse.paho.mqttv5.common.packet.MqttConnect;
import org.eclipse.paho.mqttv5.common.packet.MqttDisconnect;
Expand Down Expand Up @@ -176,8 +177,9 @@ void internalSend(MqttWireMessage message, MqttToken token) throws MqttException
public void sendNoWait(MqttWireMessage message, MqttToken token) throws MqttException {
final String methodName = "sendNoWait";

if (isConnected() || (!isConnected() && message instanceof MqttConnect)
|| (isDisconnecting() && message instanceof MqttDisconnect)) {
if (isConnected() ||
(!isConnected() && (message instanceof MqttConnect || message instanceof MqttAuth)) ||
(isDisconnecting() && message instanceof MqttDisconnect)) {

if (disconnectedMessageBuffer != null && disconnectedMessageBuffer.getMessageCount() != 0) {
// @TRACE 507=Client Connected, Offline Buffer available, but not empty. Adding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,15 @@ protected MqttWireMessage get() throws MqttException {
// Handle the case where not connected. This should only be the case if:
// - in the process of disconnecting / shutting down
// - in the process of connecting
if (pendingFlows == null || (!connected && (pendingFlows.isEmpty()
|| !((MqttWireMessage) pendingFlows.elementAt(0) instanceof MqttConnect)))) {
if (pendingFlows == null ||
(!connected &&
(pendingFlows.isEmpty() ||
!( ( pendingFlows.elementAt(0) instanceof MqttConnect) ||
( pendingFlows.elementAt(0) instanceof MqttAuth)
)
)
)
){
// @TRACE 621=no outstanding flows and not connected
log.fine(CLASS_NAME, methodName, "621");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected byte[] getVariableHeader() throws MqttException {

@Override
protected byte getMessageInfo() {
return (byte) (1);
return (byte) (0);
}

public int getReturnCode() {
Expand Down