Skip to content

Commit

Permalink
Merge branch 'SubscriptionManager' into RequestResponseClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Bret Ambrose committed Mar 4, 2024
2 parents 5d3d2cd + 249ce9f commit 4e240eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion source/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static struct aws_error_info_list s_error_list = {
DEFINE_LOG_SUBJECT_INFO(AWS_LS_MQTT5_CLIENT, "mqtt5-client", "MQTT5 client and connections"),
DEFINE_LOG_SUBJECT_INFO(AWS_LS_MQTT5_CANARY, "mqtt5-canary", "MQTT5 canary logging"),
DEFINE_LOG_SUBJECT_INFO(AWS_LS_MQTT5_TO_MQTT3_ADAPTER, "mqtt5-to-mqtt3-adapter", "MQTT5-To-MQTT3 adapter logging"),
DEFINE_LOG_SUBJECT_INFO(AWS_LS_MQTT_REQUEST_RESPONSE, "mqtt-request-response-client", "MQTT request-response client logging"),
DEFINE_LOG_SUBJECT_INFO(AWS_LS_MQTT_REQUEST_RESPONSE, "mqtt-request-response-systems", "MQTT request-response systems logging"),
};
/* clang-format on */

Expand Down
17 changes: 10 additions & 7 deletions source/request-response/subscription_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,13 @@ void aws_rr_subscription_manager_on_protocol_adapter_connection_event(
struct aws_rr_subscription_manager *manager,
const struct aws_protocol_adapter_connection_event *event) {

AWS_LOGF_DEBUG(
AWS_LS_MQTT_REQUEST_RESPONSE,
"request-response subscription manager - received a protocol adapter connection event, type %s, joined_session "
"%d",
aws_protocol_adapter_connection_event_type_to_c_str(event->event_type),
(int)(event->joined_session ? 1 : 0));

if (event->event_type == AWS_PACET_CONNECTED) {
AWS_LOGF_DEBUG(
AWS_LS_MQTT_REQUEST_RESPONSE,
"request-response subscription manager - received a protocol adapter connection event, joined_session: "
"%d",
(int)(event->joined_session ? 1 : 0));

manager->is_protocol_client_connected = true;
if (!event->joined_session) {
s_apply_session_lost(manager);
Expand All @@ -585,6 +584,10 @@ void aws_rr_subscription_manager_on_protocol_adapter_connection_event(
s_cull_unused_subscriptions(manager);
s_activate_idle_subscriptions(manager);
} else {
AWS_LOGF_DEBUG(
AWS_LS_MQTT_REQUEST_RESPONSE,
"request-response subscription manager - received a protocol adapter disconnection event");

manager->is_protocol_client_connected = false;
}
}
Expand Down

0 comments on commit 4e240eb

Please sign in to comment.