-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fix 435 #439
Fix 435 #439
Changes from all commits
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 |
---|---|---|
|
@@ -566,13 +566,9 @@ BOOST_AUTO_TEST_CASE( noclean ) { | |
break; | ||
case 3: | ||
MQTT_CHK("h_connack4"); | ||
// If clean session is not provided, than there will be a session present | ||
// if there was ever a previous connection, even if clean session was provided | ||
// on the previous connection. | ||
// This is because MQTTv5 change the semantics of the flag to "clean start" | ||
// such that it only effects the start of the session. | ||
// Post Session cleanup is handled with a timer, not with the clean session flag. | ||
BOOST_TEST(sp == true); | ||
// The previous connection is not set Session Expiry Interval. | ||
// That means session state is cleared on close. | ||
BOOST_TEST(sp == false); | ||
break; | ||
} | ||
BOOST_TEST(connack_return_code == MQTT_NS::v5::connect_reason_code::success); | ||
|
@@ -603,7 +599,22 @@ BOOST_AUTO_TEST_CASE( noclean ) { | |
case 2: | ||
MQTT_CHK("h_close3"); | ||
c->set_clean_session(false); | ||
c->connect(); | ||
switch (c->get_protocol_version()) { | ||
case MQTT_NS::protocol_version::v3_1_1: | ||
c->connect(); | ||
break; | ||
case MQTT_NS::protocol_version::v5: | ||
// set session_expiry_interval as infinity. | ||
c->connect( | ||
std::vector<MQTT_NS::v5::property_variant>{ | ||
MQTT_NS::v5::property::session_expiry_interval(0xFFFFFFFFUL) | ||
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. Is this infinity, or just maximum? It's a uint16_t, right? 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. Ah, it's actually infinity. 3.1.2.11.2 Session Expiry Interval Followed by the Four Byte Integer representing the Session Expiry Interval in seconds. It is a Protocol Error to include the Session Expiry Interval more than once. If the Session Expiry Interval is absent the value 0 is used. If it is set to 0, or is absent, the Session ends when the Network Connection is closed. If the Session Expiry Interval is 0xFFFFFFFF (UINT_MAX), the Session does not expire. The Client and Server MUST store the Session State after the Network Connection is closed if the Session Expiry Interval is greater than 0 [MQTT-3.1.2-23]. |
||
} | ||
); | ||
break; | ||
default: | ||
BOOST_CHECK(false); | ||
break; | ||
} | ||
++connect; | ||
break; | ||
case 3: | ||
|
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.
I thought that if session expiry interval was not set, that means indefinite lifetime of the session data?
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.
Nervermind. I looked it up.
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.
Ok. no problem.