Skip to content

Commit

Permalink
Merge branch 'AdapterOperationalState' into AdapterSubscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bretambrose committed Jun 26, 2023
2 parents 9cade09 + 07bfc59 commit 68c9961
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 2 additions & 6 deletions include/aws/mqtt/private/v5/mqtt3_to_mqtt5_adapter_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct aws_mqtt3_to_mqtt5_adapter_operation_publish {
Create cross thread task
Create adapter op -> Create and attach mqtt5 op
allocate id and add operation to adapter table
Add adapter op's internal ref to adapter
submit cross thread task to event loop
return id or 0
Expand All @@ -98,7 +99,7 @@ struct aws_mqtt3_to_mqtt5_adapter_operation_publish {
if terminated:
remove adapter op from table
destroy adapter op
Release internal ref to adapter
Release adapter op's internal ref to adapter
On publish completion:
Safe handler:
Expand Down Expand Up @@ -252,11 +253,6 @@ AWS_MQTT_API void aws_mqtt3_to_mqtt5_adapter_operation_table_init(
struct aws_mqtt3_to_mqtt5_adapter_operation_table *table,
struct aws_allocator *allocator);

/*
* Q: No call backs because by the time we call clean up we're terminated. Cancel all ops though?
* A: We haven't released our mqtt5 client reference yet so we are safe to internally manipulate (release our ref and
* zero completion callbacks)
*/
AWS_MQTT_API void aws_mqtt3_to_mqtt5_adapter_operation_table_clean_up(
struct aws_mqtt3_to_mqtt5_adapter_operation_table *table);

Expand Down
2 changes: 2 additions & 0 deletions source/v5/mqtt3_to_mqtt5_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,8 @@ void aws_mqtt3_to_mqtt5_adapter_operation_table_clean_up(struct aws_mqtt3_to_mqt
aws_hash_table_foreach(&table->operations, s_adapter_operation_clean_up, table);

aws_hash_table_clean_up(&table->operations);

aws_mutex_clean_up(&table->lock);
}

static uint16_t s_next_adapter_id(uint16_t current_id) {
Expand Down

0 comments on commit 68c9961

Please sign in to comment.