-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resend PUBACK and PUBREC irrespective of the DUP flag #83
Changes from 4 commits
7892145
1fb2e9d
3247e0f
fe324d9
0ff0521
53b6130
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1054,7 +1054,7 @@ static MQTTStatus_t handleIncomingPublish( MQTTContext_t * pContext, | |
* state engine. This will be handled by ignoring the | ||
* #MQTTStateCollision status from the state engine. The publish | ||
* data is not passed to the application. */ | ||
else if( ( status == MQTTStateCollision ) && ( publishInfo.dup == true ) ) | ||
else if( status == MQTTStateCollision ) | ||
{ | ||
status = MQTTSuccess; | ||
duplicatePublish = true; | ||
|
@@ -1063,8 +1063,14 @@ static MQTTStatus_t handleIncomingPublish( MQTTContext_t * pContext, | |
* for the duplicate incoming publish. */ | ||
publishRecordState = MQTT_CalculateStatePublish( MQTT_RECEIVE, | ||
publishInfo.qos ); | ||
|
||
LogDebug( ( "Incoming publish packet with packet id %u already exists.", | ||
packetIdentifier ) ); | ||
|
||
if( publishInfo.dup == false ) | ||
{ | ||
LogError( ( "DUP flag is 0 for duplicate incoming publish packet." ) ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we have a more ominous sounding error message like "Protocol violation: ..."? I think we should be clear that this isn't according to the spec. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would simply say "DUP flag is 0 for duplicate packet (MQTT-3.3.1.-1)" that gives all the breadcrumbs you need to figure it out. If you just google MQTT-3.3.1.-1 you will hit it directly. |
||
} | ||
} | ||
else | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're making this change specifically for AWS IoT Core, we should at least log a warning, if not an error. If the DUP flag isn't set, it seems to be a protocol violation (3.3.1.1):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the updated logs.