Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package aws-c-mqtt for openSUSE:Factory checked in at 2026-03-25 21:19:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/aws-c-mqtt (Old) and /work/SRC/openSUSE:Factory/.aws-c-mqtt.new.8177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "aws-c-mqtt" Wed Mar 25 21:19:50 2026 rev:17 rq:1342389 version:0.15.2 Changes: -------- --- /work/SRC/openSUSE:Factory/aws-c-mqtt/aws-c-mqtt.changes 2026-03-20 21:20:54.524251398 +0100 +++ /work/SRC/openSUSE:Factory/.aws-c-mqtt.new.8177/aws-c-mqtt.changes 2026-03-27 06:36:39.702212956 +0100 @@ -1,0 +2,8 @@ +Mon Mar 23 11:06:40 UTC 2026 - John Paul Adrian Glaubitz <[email protected]> + +- Update to version 0.15.2 + * Manual Puback to Manual Publish Acknowledgement by @sbSteveK in (#421) +- from version 0.15.1 + * Manual Puback Logging Change by @sbSteveK in (#420) + +------------------------------------------------------------------- Old: ---- v0.15.0.tar.gz New: ---- v0.15.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aws-c-mqtt.spec ++++++ --- /var/tmp/diff_new_pack.rOxjm2/_old 2026-03-27 06:36:40.834259614 +0100 +++ /var/tmp/diff_new_pack.rOxjm2/_new 2026-03-27 06:36:40.838259779 +0100 @@ -18,7 +18,7 @@ %global library_version 1_0_0 Name: aws-c-mqtt -Version: 0.15.0 +Version: 0.15.2 Release: 0 Summary: AWS C99 implementation of the MQTT 3.1.1 specification License: Apache-2.0 ++++++ v0.15.0.tar.gz -> v0.15.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-mqtt-0.15.0/include/aws/mqtt/private/v5/mqtt5_client_impl.h new/aws-c-mqtt-0.15.2/include/aws/mqtt/private/v5/mqtt5_client_impl.h --- old/aws-c-mqtt-0.15.0/include/aws/mqtt/private/v5/mqtt5_client_impl.h 2026-03-11 19:20:15.000000000 +0100 +++ new/aws-c-mqtt-0.15.2/include/aws/mqtt/private/v5/mqtt5_client_impl.h 2026-03-18 21:44:05.000000000 +0100 @@ -255,13 +255,13 @@ /* * One more than the most recently used control packet id. */ - uint64_t next_mqtt5_puback_control_id; + uint64_t next_mqtt5_pub_ack_control_id; /* These tables are used for fast search of a packet_id and control_id pair. They both set an - * aws_mqtt5_manual_puback_entry as its value */ - struct aws_hash_table manual_puback_packet_id_table; - struct aws_hash_table manual_puback_control_id_table; + * aws_mqtt5_manual_pub_ack_entry as its value */ + struct aws_hash_table manual_pub_ack_packet_id_table; + struct aws_hash_table manual_pub_ack_control_id_table; /* This table contains control ids known to be cancelled due to client disconnect for better failure messaging */ - struct aws_hash_table manual_puback_cancelled_control_id_table; + struct aws_hash_table manual_pub_ack_cancelled_control_id_table; struct aws_linked_list queued_operations; struct aws_mqtt5_operation *current_operation; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-mqtt-0.15.0/include/aws/mqtt/private/v5/mqtt5_options_storage.h new/aws-c-mqtt-0.15.2/include/aws/mqtt/private/v5/mqtt5_options_storage.h --- old/aws-c-mqtt-0.15.0/include/aws/mqtt/private/v5/mqtt5_options_storage.h 2026-03-11 19:20:15.000000000 +0100 +++ new/aws-c-mqtt-0.15.2/include/aws/mqtt/private/v5/mqtt5_options_storage.h 2026-03-18 21:44:05.000000000 +0100 @@ -102,7 +102,7 @@ struct aws_mqtt5_packet_puback_storage options_storage; - struct aws_mqtt5_manual_puback_completion_options completion_options; + struct aws_mqtt5_manual_publish_acknowledgement_completion_options completion_options; }; struct aws_mqtt5_operation_disconnect { @@ -275,7 +275,7 @@ AWS_MQTT_API struct aws_mqtt5_operation_puback *aws_mqtt5_operation_puback_new( struct aws_allocator *allocator, const struct aws_mqtt5_packet_puback_view *puback_options, - const struct aws_mqtt5_manual_puback_completion_options *completion_options); + const struct aws_mqtt5_manual_publish_acknowledgement_completion_options *completion_options); AWS_MQTT_API void aws_mqtt5_packet_puback_view_log( const struct aws_mqtt5_packet_puback_view *puback_view, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-mqtt-0.15.0/include/aws/mqtt/v5/mqtt5_client.h new/aws-c-mqtt-0.15.2/include/aws/mqtt/v5/mqtt5_client.h --- old/aws-c-mqtt-0.15.0/include/aws/mqtt/v5/mqtt5_client.h 2026-03-11 19:20:15.000000000 +0100 +++ new/aws-c-mqtt-0.15.2/include/aws/mqtt/v5/mqtt5_client.h 2026-03-18 21:44:05.000000000 +0100 @@ -295,13 +295,13 @@ void *complete_ctx); /** - * Signature of callback invoked when a manual PUBACK operation completes. + * Signature of callback invoked when a manual publish acknowledgement operation completes. * - * @param puback_result result of the PUBACK operation + * @param puback_result result of the publish acknowledgement operation * @param completion_user_data user data passed in with the completion options */ -typedef void(aws_mqtt5_manual_puback_completion_fn)( - enum aws_mqtt5_manual_puback_result puback_result, +typedef void(aws_mqtt5_manual_publish_acknowledgement_completion_fn)( + enum aws_mqtt5_manual_publish_acknowledgement_result publish_acknowledgement_result, void *completion_user_data); /** @@ -356,10 +356,10 @@ }; /** - * Completion options for the manual puback operation + * Completion options for the manual publish acknowledgement operation */ -struct aws_mqtt5_manual_puback_completion_options { - aws_mqtt5_manual_puback_completion_fn *completion_callback; +struct aws_mqtt5_manual_publish_acknowledgement_completion_options { + aws_mqtt5_manual_publish_acknowledgement_completion_fn *completion_callback; void *completion_user_data; }; @@ -757,33 +757,33 @@ const struct aws_mqtt5_publish_completion_options *completion_options); /** - * Takes manual control of PUBACK for the given PUBLISH packet. + * Takes manual control of publish acknowledgement for the given PUBLISH packet. * * This MUST only be called from within the publish received callback. A return value of 0 indicates an * invalid control id. * - * @param client mqtt5 client that received the PUBLISH packet to take manual PUBACK control from. - * @param publish_view the view of the PUBLISH packet that PUBACK control is taken from. - * @return puback_control_id of the PUBLISH packet. This can be used to schedule a PUBACK for the PUBLISH packet - * when used with the aws_mqtt5_client_invoke_puback function call. + * @param client mqtt5 client that received the PUBLISH packet to take manual publish acknowledgement control from. + * @param publish_view the view of the PUBLISH packet that publish acknowledgement control is taken from. + * @return pub_ack_control_id of the PUBLISH packet. This can be used to schedule a publish acknowledgement for the + * PUBLISH packet when used with the aws_mqtt5_client_invoke_publish_acknowledgement function call. */ -AWS_MQTT_API uint64_t aws_mqtt5_client_acquire_puback( +AWS_MQTT_API uint64_t aws_mqtt5_client_acquire_publish_acknowledgement( struct aws_mqtt5_client *client, const struct aws_mqtt5_packet_publish_view *publish_view); /** - * Send PUBACK for provided control id. Callback in completion_options will be invoked with an - * aws_mqtt5_manual_puback_result once a PUBACK operation has been completed. + * Send publish acknowledgement for provided control id. Callback in completion_options will be invoked with an + * aws_mqtt5_manual_publish_acknowledgement_result once a publish acknowledgement operation has been completed. * * @param client mqtt5 client to queue a puback for - * @param puback_control_id Control ID of aws_mqtt5_manual_puback_entry to send to broker/server - * @return success/failure of starting the manual PUBACK operation. + * @param pub_ack_control_id Control ID of aws_mqtt5_manual_pub_ack_entry to send to broker/server + * @return success/failure of starting the manual publish acknowledgement operation. */ AWS_MQTT_API -int aws_mqtt5_client_invoke_puback( +int aws_mqtt5_client_invoke_publish_acknowledgement( struct aws_mqtt5_client *client, - uint64_t puback_control_id, - const struct aws_mqtt5_manual_puback_completion_options *completion_options); + uint64_t pub_ack_control_id, + const struct aws_mqtt5_manual_publish_acknowledgement_completion_options *completion_options); /** * Queues a Subscribe operation in an mqtt5 client diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-mqtt-0.15.0/include/aws/mqtt/v5/mqtt5_types.h new/aws-c-mqtt-0.15.2/include/aws/mqtt/v5/mqtt5_types.h --- old/aws-c-mqtt-0.15.0/include/aws/mqtt/v5/mqtt5_types.h 2026-03-11 19:20:15.000000000 +0100 +++ new/aws-c-mqtt-0.15.2/include/aws/mqtt/v5/mqtt5_types.h 2026-03-18 21:44:05.000000000 +0100 @@ -144,11 +144,11 @@ * Result for manual PUBACK operations. * */ -enum aws_mqtt5_manual_puback_result { - AWS_MQTT5_MPR_SUCCESS = 0, - AWS_MQTT5_MPR_PUBACK_CANCELLED = 1, - AWS_MQTT5_MPR_PUBACK_INVALID = 2, - AWS_MQTT5_MPR_CRT_FAILURE = 3, +enum aws_mqtt5_manual_publish_acknowledgement_result { + AWS_MQTT5_MPAR_SUCCESS = 0, + AWS_MQTT5_MPAR_PUBACK_CANCELLED = 1, + AWS_MQTT5_MPAR_PUBACK_INVALID = 2, + AWS_MQTT5_MPAR_CRT_FAILURE = 3, }; /** @@ -456,14 +456,14 @@ }; /** - * This is used to track which PUBLISH packets a user has taken manual PUBACK control from. + * This is used to track which PUBLISH packets a user has taken manual publish acknowledgement control from. */ -struct aws_mqtt5_manual_puback_entry { +struct aws_mqtt5_manual_pub_ack_entry { struct aws_allocator *allocator; struct aws_ref_count ref_count; /* control id for internal tracking */ - uint64_t puback_control_id; + uint64_t pub_ack_control_id; /* packet_id of controlled publish */ uint16_t packet_id; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-mqtt-0.15.0/source/v5/mqtt5_client.c new/aws-c-mqtt-0.15.2/source/v5/mqtt5_client.c --- old/aws-c-mqtt-0.15.0/source/v5/mqtt5_client.c 2026-03-11 19:20:15.000000000 +0100 +++ new/aws-c-mqtt-0.15.2/source/v5/mqtt5_client.c 2026-03-18 21:44:05.000000000 +0100 @@ -590,37 +590,39 @@ s_reevaluate_service_task(client); } -/* This is used to move the aws_mqtt5_manual_puback_entry stored in the active table to cancelled table. We don't simply - * clear out the active table because we need to keep the entries in memory until we are fully done with them. */ -static int s_manual_puback_transfer(void *context, struct aws_hash_element *element) { - struct aws_hash_table *manual_puback_cancelled_control_id_table = context; +/* This is used to move the aws_mqtt5_manual_pub_ack_entry stored in the active table to cancelled table. We don't + * simply clear out the active table because we need to keep the entries in memory until we are fully done with them. */ +static int s_manual_pub_ack_transfer(void *context, struct aws_hash_element *element) { + struct aws_hash_table *manual_pub_ack_cancelled_control_id_table = context; - struct aws_mqtt5_manual_puback_entry *manual_puback_entry = element->value; + struct aws_mqtt5_manual_pub_ack_entry *manual_pub_ack_entry = element->value; // Add the control id to the destination table - if (aws_hash_table_put(manual_puback_cancelled_control_id_table, element->key, element->value, NULL)) { + if (aws_hash_table_put(manual_pub_ack_cancelled_control_id_table, element->key, element->value, NULL)) { return AWS_COMMON_HASH_TABLE_ITER_ERROR; } // incref the ref_count because when this entry is removed from the original set it will decref. - aws_ref_count_acquire(&manual_puback_entry->ref_count); + aws_ref_count_acquire(&manual_pub_ack_entry->ref_count); // We simply continue here and will clear (and thus decref) after we finish iterating. return AWS_COMMON_HASH_TABLE_ITER_CONTINUE; } -/* This is called when the manual puback entry is removed from a hashset to properly decref on removal */ -static void s_aws_mqtt5_manual_puback_entry_decref(void *value) { - struct aws_mqtt5_manual_puback_entry *manual_puback_entry = value; - if (manual_puback_entry != NULL) { - aws_ref_count_release(&manual_puback_entry->ref_count); +/* This is called when the manual publish acknowledgement entry is removed from a hashset to properly decref on removal + */ +static void s_aws_mqtt5_manual_pub_ack_entry_decref(void *value) { + struct aws_mqtt5_manual_pub_ack_entry *manual_pub_ack_entry = value; + if (manual_pub_ack_entry != NULL) { + aws_ref_count_release(&manual_pub_ack_entry->ref_count); } } -/* When a disconnect or stop occurs all Manual Pubacks become invalid. We clear packet ids which may be reused - * by the server and transfer manual puback entries from the active table to the cancelled table - * to provide better communication if the user attempts to invoke a PUBACK they think they have control over. */ -static void s_aws_mqtt5_reset_manual_puback_tables( +/* When a disconnect or stop occurs all publish acknowledgements become invalid. We clear packet ids which may be reused + * by the server and transfer manual publish acknowledgement entries from the active table to the cancelled table + * to provide better communication if the user attempts to invoke a publish acknowledgement they think they have control + * over. */ +static void s_aws_mqtt5_reset_manual_pub_ack_tables( struct aws_mqtt5_client_operational_state *client_operational_state) { - size_t count = aws_hash_table_get_entry_count(&client_operational_state->manual_puback_control_id_table); + size_t count = aws_hash_table_get_entry_count(&client_operational_state->manual_pub_ack_control_id_table); if (count > 0) { AWS_LOGF_DEBUG( AWS_LS_MQTT5_CLIENT, @@ -628,12 +630,12 @@ "have been cancelled.", (void *)client_operational_state->client, count); - aws_hash_table_clear(&client_operational_state->manual_puback_packet_id_table); + aws_hash_table_clear(&client_operational_state->manual_pub_ack_packet_id_table); aws_hash_table_foreach( - &client_operational_state->manual_puback_control_id_table, - s_manual_puback_transfer, - &client_operational_state->manual_puback_cancelled_control_id_table); - aws_hash_table_clear(&client_operational_state->manual_puback_control_id_table); + &client_operational_state->manual_pub_ack_control_id_table, + s_manual_pub_ack_transfer, + &client_operational_state->manual_pub_ack_cancelled_control_id_table); + aws_hash_table_clear(&client_operational_state->manual_pub_ack_control_id_table); } } @@ -651,13 +653,13 @@ if (is_final) { aws_priority_queue_clean_up(&client_operational_state->operations_by_ack_timeout); aws_hash_table_clean_up(&client_operational_state->unacked_operations_table); - aws_hash_table_clean_up(&client_operational_state->manual_puback_control_id_table); - aws_hash_table_clean_up(&client_operational_state->manual_puback_packet_id_table); - aws_hash_table_clean_up(&client_operational_state->manual_puback_cancelled_control_id_table); + aws_hash_table_clean_up(&client_operational_state->manual_pub_ack_control_id_table); + aws_hash_table_clean_up(&client_operational_state->manual_pub_ack_packet_id_table); + aws_hash_table_clean_up(&client_operational_state->manual_pub_ack_cancelled_control_id_table); } else { aws_priority_queue_clear(&client->operational_state.operations_by_ack_timeout); aws_hash_table_clear(&client_operational_state->unacked_operations_table); - s_aws_mqtt5_reset_manual_puback_tables(client_operational_state); + s_aws_mqtt5_reset_manual_pub_ack_tables(client_operational_state); } } @@ -1866,7 +1868,7 @@ static int s_aws_mqtt5_client_queue_puback( struct aws_mqtt5_client *client, uint16_t packet_id, - const struct aws_mqtt5_manual_puback_completion_options *completion_options) { + const struct aws_mqtt5_manual_publish_acknowledgement_completion_options *completion_options) { AWS_PRECONDITION(client != NULL); const struct aws_mqtt5_packet_puback_view puback_view = { @@ -1943,7 +1945,7 @@ // Check if this PUBLSIH packet is manually controlled struct aws_hash_element *elem = NULL; aws_hash_table_find( - &client->operational_state.manual_puback_packet_id_table, &publish_view->packet_id, &elem); + &client->operational_state.manual_pub_ack_packet_id_table, &publish_view->packet_id, &elem); /* This PUBLISH isn't a manually controlled PUBACK. We schedule the PUBACK to be sent immediately. */ if (elem == NULL) { @@ -2491,20 +2493,20 @@ return AWS_OP_ERR; } -struct aws_mqtt5_manual_puback_task { +struct aws_mqtt5_manual_pub_ack_task { struct aws_task task; struct aws_allocator *allocator; struct aws_mqtt5_client *client; - uint64_t puback_control_id; - struct aws_mqtt5_manual_puback_completion_options completion_options; + uint64_t pub_ack_control_id; + struct aws_mqtt5_manual_publish_acknowledgement_completion_options completion_options; }; -static void s_mqtt5_manual_puback_task_fn(struct aws_task *task, void *arg, enum aws_task_status status) { +static void s_mqtt5_manual_pub_ack_task_fn(struct aws_task *task, void *arg, enum aws_task_status status) { (void)task; - struct aws_mqtt5_manual_puback_task *manual_puback_task = arg; - struct aws_mqtt5_client *client = manual_puback_task->client; - uint64_t puback_control_id = manual_puback_task->puback_control_id; + struct aws_mqtt5_manual_pub_ack_task *manual_pub_ack_task = arg; + struct aws_mqtt5_client *client = manual_pub_ack_task->client; + uint64_t pub_ack_control_id = manual_pub_ack_task->pub_ack_control_id; if (status != AWS_TASK_STATUS_RUN_READY) { goto cleanup; @@ -2512,33 +2514,33 @@ AWS_FATAL_ASSERT(aws_event_loop_thread_is_callers_thread(client->loop)); - enum aws_mqtt5_manual_puback_result puback_result = AWS_MQTT5_MPR_SUCCESS; + enum aws_mqtt5_manual_publish_acknowledgement_result puback_result = AWS_MQTT5_MPAR_SUCCESS; struct aws_hash_element *elem = NULL; - aws_hash_table_find(&client->operational_state.manual_puback_control_id_table, &puback_control_id, &elem); + aws_hash_table_find(&client->operational_state.manual_pub_ack_control_id_table, &pub_ack_control_id, &elem); // We can schedule the PUBACK as an mqtt operation if it exists in the control id table. if (elem != NULL) { - struct aws_mqtt5_manual_puback_entry *manual_puback_entry = - (struct aws_mqtt5_manual_puback_entry *)(elem->value); + struct aws_mqtt5_manual_pub_ack_entry *manual_pub_ack_entry = + (struct aws_mqtt5_manual_pub_ack_entry *)(elem->value); AWS_LOGF_DEBUG( AWS_LS_MQTT5_CLIENT, "id=%p: Scheuduling puback for control id: %llu for packet id: %d \n", (void *)client, - (unsigned long long)manual_puback_entry->puback_control_id, - manual_puback_entry->packet_id); + (unsigned long long)manual_pub_ack_entry->pub_ack_control_id, + manual_pub_ack_entry->packet_id); - uint16_t packet_id = manual_puback_entry->packet_id; + uint16_t packet_id = manual_pub_ack_entry->packet_id; - aws_hash_table_remove(&client->operational_state.manual_puback_packet_id_table, &packet_id, NULL, NULL); - // This removal from the control id table will also deallocate the manual puback entry. + aws_hash_table_remove(&client->operational_state.manual_pub_ack_packet_id_table, &packet_id, NULL, NULL); + // This removal from the control id table will also deallocate the manual publish acknowledgement entry. aws_hash_table_remove( - &client->operational_state.manual_puback_control_id_table, &puback_control_id, NULL, NULL); + &client->operational_state.manual_pub_ack_control_id_table, &pub_ack_control_id, NULL, NULL); - if (s_aws_mqtt5_client_queue_puback(client, packet_id, &manual_puback_task->completion_options)) { + if (s_aws_mqtt5_client_queue_puback(client, packet_id, &manual_pub_ack_task->completion_options)) { // this failure doesn't trigger the completion so we do it here before cleanup. - puback_result = AWS_MQTT5_MPR_CRT_FAILURE; + puback_result = AWS_MQTT5_MPAR_CRT_FAILURE; goto completion; } @@ -2547,90 +2549,92 @@ } // If the control id isn't in the active table, check if it's been cancelled. - aws_hash_table_find(&client->operational_state.manual_puback_cancelled_control_id_table, &puback_control_id, &elem); + aws_hash_table_find( + &client->operational_state.manual_pub_ack_cancelled_control_id_table, &pub_ack_control_id, &elem); if (elem != NULL) { AWS_LOGF_DEBUG( AWS_LS_MQTT5_CLIENT, - "id=%p: puback_control_id: %llu has been cancelled due to a disconnection.", + "id=%p: pub_ack_control_id: %llu has been cancelled due to a disconnection.", (void *)client, - (unsigned long long)puback_control_id); + (unsigned long long)pub_ack_control_id); // A cancelled control id has been used so it can be cleared from the table and deallocated. We only report // a cancellation once. Past that we will simply treat it as invalid. aws_hash_table_remove( - &client->operational_state.manual_puback_cancelled_control_id_table, &puback_control_id, NULL, NULL); - puback_result = AWS_MQTT5_MPR_PUBACK_CANCELLED; + &client->operational_state.manual_pub_ack_cancelled_control_id_table, &pub_ack_control_id, NULL, NULL); + puback_result = AWS_MQTT5_MPAR_PUBACK_CANCELLED; goto completion; } AWS_LOGF_DEBUG( AWS_LS_MQTT5_CLIENT, - "id=%p: puback_control_id: %llu is not tracked in any way.", + "id=%p: pub_ack_control_id: %llu is not tracked in any way.", (void *)client, - (unsigned long long)puback_control_id); - puback_result = AWS_MQTT5_MPR_PUBACK_INVALID; + (unsigned long long)pub_ack_control_id); + puback_result = AWS_MQTT5_MPAR_PUBACK_INVALID; completion: // We call the completion callback here in cases where there is no PUBACK operation scheduled on the client. - if (manual_puback_task->completion_options.completion_callback != NULL) { - manual_puback_task->completion_options.completion_callback( - puback_result, manual_puback_task->completion_options.completion_user_data); + if (manual_pub_ack_task->completion_options.completion_callback != NULL) { + manual_pub_ack_task->completion_options.completion_callback( + puback_result, manual_pub_ack_task->completion_options.completion_user_data); } cleanup: - aws_mqtt5_client_release(manual_puback_task->client); - aws_mem_release(manual_puback_task->allocator, manual_puback_task); + aws_mqtt5_client_release(manual_pub_ack_task->client); + aws_mem_release(manual_pub_ack_task->allocator, manual_pub_ack_task); } -// Schedules task to process a manual PUBACK for provided puback_control_id -int aws_mqtt5_client_invoke_puback( +// Schedules task to process a manual publish acknowledgement for provided pub_ack_control_id +int aws_mqtt5_client_invoke_publish_acknowledgement( struct aws_mqtt5_client *client, - uint64_t puback_control_id, - const struct aws_mqtt5_manual_puback_completion_options *completion_options) { + uint64_t pub_ack_control_id, + const struct aws_mqtt5_manual_publish_acknowledgement_completion_options *completion_options) { AWS_PRECONDITION(client != NULL); - struct aws_mqtt5_manual_puback_task *manual_puback_task = - aws_mem_calloc(client->allocator, 1, sizeof(struct aws_mqtt5_manual_puback_task)); + struct aws_mqtt5_manual_pub_ack_task *manual_pub_ack_task = + aws_mem_calloc(client->allocator, 1, sizeof(struct aws_mqtt5_manual_pub_ack_task)); aws_task_init( - &manual_puback_task->task, s_mqtt5_manual_puback_task_fn, manual_puback_task, "Mqtt5ManualPubackTask"); - manual_puback_task->allocator = client->allocator; - manual_puback_task->client = aws_mqtt5_client_acquire(client); - manual_puback_task->puback_control_id = puback_control_id; + &manual_pub_ack_task->task, s_mqtt5_manual_pub_ack_task_fn, manual_pub_ack_task, "Mqtt5ManualPubackTask"); + manual_pub_ack_task->allocator = client->allocator; + manual_pub_ack_task->client = aws_mqtt5_client_acquire(client); + manual_pub_ack_task->pub_ack_control_id = pub_ack_control_id; if (completion_options != NULL) { - manual_puback_task->completion_options = *completion_options; + manual_pub_ack_task->completion_options = *completion_options; } - aws_event_loop_schedule_task_now(client->loop, &manual_puback_task->task); + aws_event_loop_schedule_task_now(client->loop, &manual_pub_ack_task->task); return AWS_OP_SUCCESS; } -static void s_aws_mqtt5_manual_puback_entry_destroy(void *object) { +static void s_aws_mqtt5_manual_pub_ack_entry_destroy(void *object) { if (object == NULL) { return; } - struct aws_mqtt5_manual_puback_entry *manual_puback_entry = object; - aws_mem_release(manual_puback_entry->allocator, manual_puback_entry); + struct aws_mqtt5_manual_pub_ack_entry *manual_pub_ack_entry = object; + aws_mem_release(manual_pub_ack_entry->allocator, manual_pub_ack_entry); } -static struct aws_mqtt5_manual_puback_entry *s_aws_mqtt_manual_puback_entry_new( +static struct aws_mqtt5_manual_pub_ack_entry *s_aws_mqtt_manual_pub_ack_entry_new( struct aws_allocator *allocator, uint16_t packet_id, - uint64_t puback_control_id) { + uint64_t pub_ack_control_id) { - struct aws_mqtt5_manual_puback_entry *manual_puback_entry = - aws_mem_calloc(allocator, 1, sizeof(struct aws_mqtt5_manual_puback_entry)); + struct aws_mqtt5_manual_pub_ack_entry *manual_pub_ack_entry = + aws_mem_calloc(allocator, 1, sizeof(struct aws_mqtt5_manual_pub_ack_entry)); - manual_puback_entry->allocator = allocator; - aws_ref_count_init(&manual_puback_entry->ref_count, manual_puback_entry, s_aws_mqtt5_manual_puback_entry_destroy); - manual_puback_entry->packet_id = packet_id; - manual_puback_entry->puback_control_id = puback_control_id; + manual_pub_ack_entry->allocator = allocator; + aws_ref_count_init( + &manual_pub_ack_entry->ref_count, manual_pub_ack_entry, s_aws_mqtt5_manual_pub_ack_entry_destroy); + manual_pub_ack_entry->packet_id = packet_id; + manual_pub_ack_entry->pub_ack_control_id = pub_ack_control_id; - return manual_puback_entry; + return manual_pub_ack_entry; } -uint64_t aws_mqtt5_client_acquire_puback( +uint64_t aws_mqtt5_client_acquire_publish_acknowledgement( struct aws_mqtt5_client *client, const struct aws_mqtt5_packet_publish_view *publish_view) { AWS_PRECONDITION(client != NULL); @@ -2639,8 +2643,6 @@ AWS_FATAL_ASSERT(aws_event_loop_thread_is_callers_thread(client->loop)); if (publish_view->qos == AWS_MQTT5_QOS_AT_MOST_ONCE) { - AWS_LOGF_ERROR( - AWS_LS_MQTT5_CLIENT, "id=%p: PUBACK control cannot be taken for a QoS 0 PUBLISH packet.", (void *)client); return 0; } @@ -2648,63 +2650,62 @@ * PUBLISH that has its PUBACK acquired but hasn't been sent for long enough that the broker has sent the PUBLISH * packet again. */ struct aws_hash_element *elem = NULL; - aws_hash_table_find(&client->operational_state.manual_puback_packet_id_table, &publish_view->packet_id, &elem); + aws_hash_table_find(&client->operational_state.manual_pub_ack_packet_id_table, &publish_view->packet_id, &elem); if (elem != NULL) { /* In this case we simply provide the same control_id that was already sent before. We do not want to create a * second control_id with the same packet_id. It is the user's responsibility to know that they have two PUBACKs * for the same PUBLISH. */ - AWS_LOGF_WARN( - AWS_LS_MQTT5_CLIENT, - "id=%p: PUBACK acquire called on a PUBLISH that is already under user control.", - (void *)client); - struct aws_mqtt5_manual_puback_entry *entry = elem->value; - return entry->puback_control_id; + struct aws_mqtt5_manual_pub_ack_entry *entry = elem->value; + return entry->pub_ack_control_id; } - // The current_control_packet_id is incremented each time a new manual puback is scheduled. - uint64_t current_control_packet_id = client->operational_state.next_mqtt5_puback_control_id; - struct aws_mqtt5_manual_puback_entry *manual_puback = - s_aws_mqtt_manual_puback_entry_new(client->allocator, publish_view->packet_id, current_control_packet_id); + // The current_control_packet_id is incremented each time a new manual publish acknowledgement is scheduled. + uint64_t current_control_packet_id = client->operational_state.next_mqtt5_pub_ack_control_id; + struct aws_mqtt5_manual_pub_ack_entry *manual_pub_ack = + s_aws_mqtt_manual_pub_ack_entry_new(client->allocator, publish_view->packet_id, current_control_packet_id); - /* Allows lookup of manual puback entries by packet id. */ + /* Allows lookup of manual publish acknowledgement entries by packet id. */ if (aws_hash_table_put( - &client->operational_state.manual_puback_packet_id_table, &manual_puback->packet_id, manual_puback, NULL)) { + &client->operational_state.manual_pub_ack_packet_id_table, + &manual_pub_ack->packet_id, + manual_pub_ack, + NULL)) { int error_code = aws_last_error(); AWS_LOGF_ERROR( AWS_LS_MQTT5_CLIENT, - "id=%p: Failed to insert manual PUBACK entry into packet ID table: %d(%s)", + "id=%p: Failed to insert manual publish acknowledgement entry into packet ID table: %d(%s)", (void *)client, error_code, aws_error_debug_str(error_code)); goto cleanup; } - /* We incref here because the packet_id table also has a ref to the manual_puback */ - aws_ref_count_acquire(&manual_puback->ref_count); + /* We incref here because the packet_id table also has a ref to the manual_pub_ack */ + aws_ref_count_acquire(&manual_pub_ack->ref_count); - /* Allows lookup of manual puback entries by control id */ + /* Allows lookup of manual publish acknowledgement entries by control id */ if (aws_hash_table_put( - &client->operational_state.manual_puback_control_id_table, - &manual_puback->puback_control_id, - manual_puback, + &client->operational_state.manual_pub_ack_control_id_table, + &manual_pub_ack->pub_ack_control_id, + manual_pub_ack, NULL)) { int error_code = aws_last_error(); AWS_LOGF_ERROR( AWS_LS_MQTT5_CLIENT, - "id=%p: Failed to insert manual PUBACK entry into control ID table: %d(%s)", + "id=%p: Failed to insert manual publish acknowledgement entry into control ID table: %d(%s)", (void *)client, error_code, aws_error_debug_str(error_code)); - // clean up the manual puback entry from the packet id table and deallocate. + // clean up the manual publish acknowledgement entry from the packet id table and deallocate. aws_hash_table_remove( - &client->operational_state.manual_puback_packet_id_table, &manual_puback->packet_id, NULL, NULL); + &client->operational_state.manual_pub_ack_packet_id_table, &manual_pub_ack->packet_id, NULL, NULL); goto cleanup; } - /* Increment next_mqtt5_puback_control_id for next use */ - client->operational_state.next_mqtt5_puback_control_id = current_control_packet_id + 1; + /* Increment next_mqtt5_pub_ack_control_id for next use */ + client->operational_state.next_mqtt5_pub_ack_control_id = current_control_packet_id + 1; size_t in_flight_unacked_publishes = - aws_hash_table_get_entry_count(&client->operational_state.manual_puback_control_id_table); + aws_hash_table_get_entry_count(&client->operational_state.manual_pub_ack_control_id_table); if (in_flight_unacked_publishes >= 100) { AWS_LOGF_WARN( AWS_LS_MQTT5_CLIENT, @@ -2715,16 +2716,17 @@ } else { AWS_LOGF_DEBUG( AWS_LS_MQTT5_CLIENT, - "id=%p: Manual PUBACK control taken for a PUBLISH packet. Current in-flight PUBACKs under user control: " + "id=%p: manual publish acknowledgement control taken for a PUBLISH packet. Current in-flight PUBACKs under " + "user control: " "%zu", (void *)client, in_flight_unacked_publishes); } - return manual_puback->puback_control_id; + return manual_pub_ack->pub_ack_control_id; cleanup: - aws_mem_release(manual_puback->allocator, manual_puback); + aws_mem_release(manual_pub_ack->allocator, manual_pub_ack); return 0; } @@ -2822,35 +2824,35 @@ } if (aws_hash_table_init( - &client_operational_state->manual_puback_packet_id_table, + &client_operational_state->manual_pub_ack_packet_id_table, allocator, DEFAULT_MQTT5_OPERATION_TABLE_SIZE, aws_mqtt_hash_uint16_t, aws_mqtt_compare_uint16_t_eq, NULL, - s_aws_mqtt5_manual_puback_entry_decref)) { + s_aws_mqtt5_manual_pub_ack_entry_decref)) { return AWS_OP_ERR; } if (aws_hash_table_init( - &client_operational_state->manual_puback_control_id_table, + &client_operational_state->manual_pub_ack_control_id_table, allocator, DEFAULT_MQTT5_OPERATION_TABLE_SIZE, aws_mqtt_hash_uint64_t, aws_mqtt_compare_uint64_t_eq, NULL, - s_aws_mqtt5_manual_puback_entry_decref)) { + s_aws_mqtt5_manual_pub_ack_entry_decref)) { return AWS_OP_ERR; } if (aws_hash_table_init( - &client_operational_state->manual_puback_cancelled_control_id_table, + &client_operational_state->manual_pub_ack_cancelled_control_id_table, allocator, DEFAULT_MQTT5_OPERATION_TABLE_SIZE, aws_mqtt_hash_uint64_t, aws_mqtt_compare_uint64_t_eq, NULL, - s_aws_mqtt5_manual_puback_entry_decref)) { + s_aws_mqtt5_manual_pub_ack_entry_decref)) { return AWS_OP_ERR; } @@ -2864,7 +2866,7 @@ } client_operational_state->next_mqtt_packet_id = 1; - client_operational_state->next_mqtt5_puback_control_id = 1; + client_operational_state->next_mqtt5_pub_ack_control_id = 1; client_operational_state->current_operation = NULL; client_operational_state->client = client; @@ -2980,7 +2982,7 @@ aws_hash_table_clear(&client->operational_state.unacked_operations_table); aws_priority_queue_clear(&client->operational_state.operations_by_ack_timeout); - s_aws_mqtt5_reset_manual_puback_tables(client_operational_state); + s_aws_mqtt5_reset_manual_pub_ack_tables(client_operational_state); /* * Prevents inbound resolution on the highly unlikely, illegal server behavior of sending a PUBLISH before diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-mqtt-0.15.0/source/v5/mqtt5_options_storage.c new/aws-c-mqtt-0.15.2/source/v5/mqtt5_options_storage.c --- old/aws-c-mqtt-0.15.0/source/v5/mqtt5_options_storage.c 2026-03-11 19:20:15.000000000 +0100 +++ new/aws-c-mqtt-0.15.2/source/v5/mqtt5_options_storage.c 2026-03-18 21:44:05.000000000 +0100 @@ -2296,9 +2296,9 @@ (void)completion_view; struct aws_mqtt5_operation_puback *puback_op = operation->impl; - /* Completion callback on manual PUBACK. + /* Completion callback on manual publish acknowledgement. * Completion callback options are not currently bound out as there is an edge case where - * we would return a successful completion of the manual puback as a redriven PUBLISH packet + * we would return a successful completion of the manual publish acknowledgement as a redriven PUBLISH packet * is simultaneously received. This could cause confusion to the user and cause them to * assume the redriven PUBLISH is a new PUBLISH and not a duplicate of the one they have just * gotten a PUBACK invoke success from. We may re-instate this in the future upon customer @@ -2306,14 +2306,14 @@ * event we need to track down bugs for a user or ourselves. */ if (puback_op->completion_options.completion_callback != NULL) { - // Convert error_code to manual puback result - enum aws_mqtt5_manual_puback_result puback_result = AWS_MQTT5_MPR_SUCCESS; + // Convert error_code to manual publish acknowledgement result + enum aws_mqtt5_manual_publish_acknowledgement_result puback_result = AWS_MQTT5_MPAR_SUCCESS; if (error_code != AWS_OP_SUCCESS) { /* There is a significant list of possible errors that could have occurred during the processing of a * PUBACK. Instead of mapping each one, we report a CRT failure which should indicate the important part. * That the PUBACK was not sent and it's likely they will receive a duplicate PUBLISH. If they want more * details the logs will need to be investigated. */ - puback_result = AWS_MQTT5_MPR_CRT_FAILURE; + puback_result = AWS_MQTT5_MPAR_CRT_FAILURE; } puback_op->completion_options.completion_callback( puback_result, puback_op->completion_options.completion_user_data); @@ -2343,7 +2343,7 @@ struct aws_mqtt5_operation_puback *aws_mqtt5_operation_puback_new( struct aws_allocator *allocator, const struct aws_mqtt5_packet_puback_view *puback_options, - const struct aws_mqtt5_manual_puback_completion_options *completion_options) { + const struct aws_mqtt5_manual_publish_acknowledgement_completion_options *completion_options) { AWS_PRECONDITION(allocator != NULL); AWS_PRECONDITION(puback_options != NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-mqtt-0.15.0/tests/CMakeLists.txt new/aws-c-mqtt-0.15.2/tests/CMakeLists.txt --- old/aws-c-mqtt-0.15.0/tests/CMakeLists.txt 2026-03-11 19:20:15.000000000 +0100 +++ new/aws-c-mqtt-0.15.2/tests/CMakeLists.txt 2026-03-18 21:44:05.000000000 +0100 @@ -402,13 +402,13 @@ add_test_case(mqtt5_client_outbound_alias_manual_success_a_b_ar_br) add_test_case(mqtt5_client_outbound_alias_lru_success_a_b_c_br_cr_a) -# MQTT5 manual puback tests +# MQTT5 manual publish acknowledgement tests -add_test_case(mqtt5_client_manual_puback_basic_success) -add_test_case(mqtt5_client_manual_puback_no_auto_puback) -add_test_case(mqtt5_client_manual_puback_invalid_control_id) -add_test_case(mqtt5_client_manual_puback_multiple_publishes) -add_test_case(mqtt5_client_manual_puback_disconnect_cancellation) +add_test_case(mqtt5_client_manual_pub_ack_basic_success) +add_test_case(mqtt5_client_manual_pub_ack_no_auto_puback) +add_test_case(mqtt5_client_manual_pub_ack_invalid_control_id) +add_test_case(mqtt5_client_manual_pub_ack_multiple_publishes) +add_test_case(mqtt5_client_manual_pub_ack_disconnect_cancellation) # Mqtt5 Metrics tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-mqtt-0.15.0/tests/v5/mqtt5_client_manual_puback_tests.c new/aws-c-mqtt-0.15.2/tests/v5/mqtt5_client_manual_puback_tests.c --- old/aws-c-mqtt-0.15.0/tests/v5/mqtt5_client_manual_puback_tests.c 2026-03-11 19:20:15.000000000 +0100 +++ new/aws-c-mqtt-0.15.2/tests/v5/mqtt5_client_manual_puback_tests.c 2026-03-18 21:44:05.000000000 +0100 @@ -15,17 +15,17 @@ #include <aws/testing/aws_test_harness.h> /** - * Test context for manual PUBACK tests + * Test context for manual publish acknowledgement tests */ -struct aws_mqtt5_manual_puback_test_context { +struct aws_mqtt5_manual_pub_ack_test_context { struct aws_mqtt5_client_mock_test_fixture *test_fixture; - /* Control IDs for manual puback */ - uint64_t puback_control_ids[10]; + /* Control IDs for manual publish acknowledgement */ + uint64_t pub_ack_control_ids[10]; size_t puback_control_count; - /* Results from manual puback operations */ - enum aws_mqtt5_manual_puback_result puback_results[10]; + /* Results from manual publish acknowledgement operations */ + enum aws_mqtt5_manual_publish_acknowledgement_result puback_results[10]; size_t puback_result_count; /* Tracking flags */ @@ -39,13 +39,15 @@ size_t received_packet_id_count; }; -static void s_manual_puback_test_context_init(struct aws_mqtt5_manual_puback_test_context *context) { +static void s_manual_pub_ack_test_context_init(struct aws_mqtt5_manual_pub_ack_test_context *context) { AWS_ZERO_STRUCT(*context); } -static void s_manual_puback_completion_fn(enum aws_mqtt5_manual_puback_result puback_result, void *complete_ctx) { +static void s_manual_pub_ack_completion_fn( + enum aws_mqtt5_manual_publish_acknowledgement_result puback_result, + void *complete_ctx) { - struct aws_mqtt5_manual_puback_test_context *context = complete_ctx; + struct aws_mqtt5_manual_pub_ack_test_context *context = complete_ctx; struct aws_mqtt5_client_mock_test_fixture *test_fixture = context->test_fixture; aws_mutex_lock(&test_fixture->lock); @@ -61,21 +63,21 @@ aws_condition_variable_notify_all(&test_fixture->signal); } -static bool s_manual_puback_publish_received_handler( +static bool s_manual_pub_ack_publish_received_handler( const struct aws_mqtt5_packet_publish_view *publish, void *user_data) { - struct aws_mqtt5_manual_puback_test_context *context = user_data; + struct aws_mqtt5_manual_pub_ack_test_context *context = user_data; struct aws_mqtt5_client_mock_test_fixture *test_fixture = context->test_fixture; if (publish->qos == AWS_MQTT5_QOS_AT_LEAST_ONCE) { aws_mutex_lock(&test_fixture->lock); - /* Acquire manual puback control */ - uint64_t control_id = aws_mqtt5_client_acquire_puback(test_fixture->client, publish); + /* Acquire manual publish acknowledgement control */ + uint64_t control_id = aws_mqtt5_client_acquire_publish_acknowledgement(test_fixture->client, publish); - if (context->puback_control_count < AWS_ARRAY_SIZE(context->puback_control_ids)) { - context->puback_control_ids[context->puback_control_count++] = control_id; + if (context->puback_control_count < AWS_ARRAY_SIZE(context->pub_ack_control_ids)) { + context->pub_ack_control_ids[context->puback_control_count++] = control_id; } if (context->received_packet_id_count < AWS_ARRAY_SIZE(context->received_packet_ids)) { @@ -94,35 +96,35 @@ return false; } -static bool s_manual_puback_callback_invoked(void *arg) { - struct aws_mqtt5_manual_puback_test_context *context = arg; +static bool s_manual_pub_ack_callback_invoked(void *arg) { + struct aws_mqtt5_manual_pub_ack_test_context *context = arg; return context->puback_callback_invoked; } -static void s_wait_for_manual_puback_callback(struct aws_mqtt5_manual_puback_test_context *context) { +static void s_wait_for_manual_pub_ack_callback(struct aws_mqtt5_manual_pub_ack_test_context *context) { struct aws_mqtt5_client_mock_test_fixture *test_fixture = context->test_fixture; aws_mutex_lock(&test_fixture->lock); aws_condition_variable_wait_pred( - &test_fixture->signal, &test_fixture->lock, s_manual_puback_callback_invoked, context); + &test_fixture->signal, &test_fixture->lock, s_manual_pub_ack_callback_invoked, context); aws_mutex_unlock(&test_fixture->lock); } -static bool s_manual_puback_publish_received(void *arg) { - struct aws_mqtt5_manual_puback_test_context *context = arg; +static bool s_manual_pub_ack_publish_received(void *arg) { + struct aws_mqtt5_manual_pub_ack_test_context *context = arg; return context->publish_received; } -static void s_wait_for_manual_puback_publish(struct aws_mqtt5_manual_puback_test_context *context) { +static void s_wait_for_manual_pub_ack_publish(struct aws_mqtt5_manual_pub_ack_test_context *context) { struct aws_mqtt5_client_mock_test_fixture *test_fixture = context->test_fixture; aws_mutex_lock(&test_fixture->lock); aws_condition_variable_wait_pred( - &test_fixture->signal, &test_fixture->lock, s_manual_puback_publish_received, context); + &test_fixture->signal, &test_fixture->lock, s_manual_pub_ack_publish_received, context); aws_mutex_unlock(&test_fixture->lock); } -static void s_wait_for_n_manual_puback_publishes(struct aws_mqtt5_manual_puback_test_context *context, size_t count) { +static void s_wait_for_n_manual_pub_ack_publishes(struct aws_mqtt5_manual_pub_ack_test_context *context, size_t count) { struct aws_mqtt5_client_mock_test_fixture *test_fixture = context->test_fixture; aws_mutex_lock(&test_fixture->lock); @@ -132,7 +134,7 @@ aws_mutex_unlock(&test_fixture->lock); } -static void s_wait_for_n_manual_puback_callbacks(struct aws_mqtt5_manual_puback_test_context *context, size_t count) { +static void s_wait_for_n_manual_pub_ack_callbacks(struct aws_mqtt5_manual_pub_ack_test_context *context, size_t count) { struct aws_mqtt5_client_mock_test_fixture *test_fixture = context->test_fixture; aws_mutex_lock(&test_fixture->lock); @@ -146,7 +148,7 @@ static uint8_t s_test_topic[] = "test/manual/puback"; static uint8_t s_test_payload[] = "test_payload"; -struct aws_mqtt5_server_manual_puback_context { +struct aws_mqtt5_server_manual_pub_ack_context { struct aws_mqtt5_client_mock_test_fixture *test_fixture; bool publish_sent; bool connack_sent; @@ -157,7 +159,7 @@ struct aws_mqtt5_server_mock_connection_context *mock_server, void *user_data) { - struct aws_mqtt5_server_manual_puback_context *context = user_data; + struct aws_mqtt5_server_manual_pub_ack_context *context = user_data; if (context->publish_sent || !context->connack_sent) { return; @@ -194,20 +196,20 @@ int result = aws_mqtt5_mock_server_handle_connect_always_succeed(packet, connection, user_data); - struct aws_mqtt5_server_manual_puback_context *context = user_data; + struct aws_mqtt5_server_manual_pub_ack_context *context = user_data; context->connack_sent = true; return result; } /** - * Basic manual PUBACK success + * Basic manual publish acknowledgement success * - Server sends QoS1 PUBLISH - * - Client acquires manual puback control + * - Client acquires manual publish acknowledgement control * - Client invokes puback * - Verify success result and server receives PUBACK */ -static int s_mqtt5_client_manual_puback_basic_success_fn(struct aws_allocator *allocator, void *ctx) { +static int s_mqtt5_client_manual_pub_ack_basic_success_fn(struct aws_allocator *allocator, void *ctx) { (void)ctx; aws_mqtt_library_init(allocator); @@ -215,10 +217,10 @@ struct mqtt5_client_test_options test_options; aws_mqtt5_client_test_init_default_options(&test_options); - struct aws_mqtt5_manual_puback_test_context puback_context; - s_manual_puback_test_context_init(&puback_context); + struct aws_mqtt5_manual_pub_ack_test_context puback_context; + s_manual_pub_ack_test_context_init(&puback_context); - struct aws_mqtt5_server_manual_puback_context server_context = { + struct aws_mqtt5_server_manual_pub_ack_context server_context = { .publish_sent = false, .connack_sent = false, .publishes_to_send = 1, @@ -244,7 +246,7 @@ struct aws_mqtt5_listener_config listener_config = { .client = test_context.client, .listener_callbacks = { - .listener_publish_received_handler = s_manual_puback_publish_received_handler, + .listener_publish_received_handler = s_manual_pub_ack_publish_received_handler, .listener_publish_received_handler_user_data = &puback_context, }}; @@ -256,30 +258,31 @@ aws_wait_for_connected_lifecycle_event(&test_context); /* Wait for publish to be received */ - s_wait_for_manual_puback_publish(&puback_context); + s_wait_for_manual_pub_ack_publish(&puback_context); /* Verify we got a control ID */ aws_mutex_lock(&test_context.lock); ASSERT_TRUE(puback_context.puback_control_count == 1); - ASSERT_TRUE(puback_context.puback_control_ids[0] != 0); - uint64_t control_id = puback_context.puback_control_ids[0]; + ASSERT_TRUE(puback_context.pub_ack_control_ids[0] != 0); + uint64_t control_id = puback_context.pub_ack_control_ids[0]; aws_mutex_unlock(&test_context.lock); - /* Invoke manual puback */ - struct aws_mqtt5_manual_puback_completion_options completion_options = { - .completion_callback = s_manual_puback_completion_fn, + /* Invoke manual publish acknowledgement */ + struct aws_mqtt5_manual_publish_acknowledgement_completion_options completion_options = { + .completion_callback = s_manual_pub_ack_completion_fn, .completion_user_data = &puback_context, }; - ASSERT_SUCCESS(aws_mqtt5_client_invoke_puback(test_context.client, control_id, &completion_options)); + ASSERT_SUCCESS( + aws_mqtt5_client_invoke_publish_acknowledgement(test_context.client, control_id, &completion_options)); /* Wait for completion callback */ - s_wait_for_manual_puback_callback(&puback_context); + s_wait_for_manual_pub_ack_callback(&puback_context); /* Verify success result */ aws_mutex_lock(&test_context.lock); ASSERT_INT_EQUALS(1, puback_context.puback_result_count); - ASSERT_INT_EQUALS(AWS_MQTT5_MPR_SUCCESS, puback_context.puback_results[0]); + ASSERT_INT_EQUALS(AWS_MQTT5_MPAR_SUCCESS, puback_context.puback_results[0]); aws_mutex_unlock(&test_context.lock); /* Clean up */ @@ -293,17 +296,17 @@ return AWS_OP_SUCCESS; } -AWS_TEST_CASE(mqtt5_client_manual_puback_basic_success, s_mqtt5_client_manual_puback_basic_success_fn) +AWS_TEST_CASE(mqtt5_client_manual_pub_ack_basic_success, s_mqtt5_client_manual_pub_ack_basic_success_fn) /** * Verify no automatic PUBACK when manual control taken * - Server sends QoS1 PUBLISH - * - Client acquires manual puback control + * - Client acquires manual publish acknowledgement control * - Wait to verify no automatic PUBACK sent - * - Client invokes manual puback + * - Client invokes manual publish acknowledgement * - Verify PUBACK is now sent */ -static int s_mqtt5_client_manual_puback_no_auto_puback_fn(struct aws_allocator *allocator, void *ctx) { +static int s_mqtt5_client_manual_pub_ack_no_auto_puback_fn(struct aws_allocator *allocator, void *ctx) { (void)ctx; aws_mqtt_library_init(allocator); @@ -311,10 +314,10 @@ struct mqtt5_client_test_options test_options; aws_mqtt5_client_test_init_default_options(&test_options); - struct aws_mqtt5_manual_puback_test_context puback_context; - s_manual_puback_test_context_init(&puback_context); + struct aws_mqtt5_manual_pub_ack_test_context puback_context; + s_manual_pub_ack_test_context_init(&puback_context); - struct aws_mqtt5_server_manual_puback_context server_context = { + struct aws_mqtt5_server_manual_pub_ack_context server_context = { .publish_sent = false, .connack_sent = false, .publishes_to_send = 1, @@ -340,7 +343,7 @@ struct aws_mqtt5_listener_config listener_config = { .client = test_context.client, .listener_callbacks = { - .listener_publish_received_handler = s_manual_puback_publish_received_handler, + .listener_publish_received_handler = s_manual_pub_ack_publish_received_handler, .listener_publish_received_handler_user_data = &puback_context, }}; @@ -349,10 +352,10 @@ ASSERT_SUCCESS(aws_mqtt5_client_start(test_context.client)); aws_wait_for_connected_lifecycle_event(&test_context); - s_wait_for_manual_puback_publish(&puback_context); + s_wait_for_manual_pub_ack_publish(&puback_context); aws_mutex_lock(&test_context.lock); - uint64_t control_id = puback_context.puback_control_ids[0]; + uint64_t control_id = puback_context.pub_ack_control_ids[0]; aws_mutex_unlock(&test_context.lock); /* Wait a bit to ensure no automatic PUBACK is sent */ @@ -373,14 +376,15 @@ ASSERT_FALSE(found_puback); aws_mutex_unlock(&test_context.lock); - /* Now invoke manual puback */ - struct aws_mqtt5_manual_puback_completion_options completion_options = { - .completion_callback = s_manual_puback_completion_fn, + /* Now invoke manual publish acknowledgement */ + struct aws_mqtt5_manual_publish_acknowledgement_completion_options completion_options = { + .completion_callback = s_manual_pub_ack_completion_fn, .completion_user_data = &puback_context, }; - ASSERT_SUCCESS(aws_mqtt5_client_invoke_puback(test_context.client, control_id, &completion_options)); - s_wait_for_manual_puback_callback(&puback_context); + ASSERT_SUCCESS( + aws_mqtt5_client_invoke_publish_acknowledgement(test_context.client, control_id, &completion_options)); + s_wait_for_manual_pub_ack_callback(&puback_context); /* Verify PUBACK now received by server */ aws_thread_current_sleep(aws_timestamp_convert(100, AWS_TIMESTAMP_MILLIS, AWS_TIMESTAMP_NANOS, NULL)); @@ -409,14 +413,14 @@ return AWS_OP_SUCCESS; } -AWS_TEST_CASE(mqtt5_client_manual_puback_no_auto_puback, s_mqtt5_client_manual_puback_no_auto_puback_fn) +AWS_TEST_CASE(mqtt5_client_manual_pub_ack_no_auto_puback, s_mqtt5_client_manual_pub_ack_no_auto_puback_fn) /** * Invalid control ID * - Invoke puback with invalid control ID - * - Verify AWS_MQTT5_MPR_PUBACK_INVALID result + * - Verify AWS_MQTT5_MPAR_PUBACK_INVALID result */ -static int s_mqtt5_client_manual_puback_invalid_control_id_fn(struct aws_allocator *allocator, void *ctx) { +static int s_mqtt5_client_manual_pub_ack_invalid_control_id_fn(struct aws_allocator *allocator, void *ctx) { (void)ctx; aws_mqtt_library_init(allocator); @@ -424,8 +428,8 @@ struct mqtt5_client_test_options test_options; aws_mqtt5_client_test_init_default_options(&test_options); - struct aws_mqtt5_manual_puback_test_context puback_context; - s_manual_puback_test_context_init(&puback_context); + struct aws_mqtt5_manual_pub_ack_test_context puback_context; + s_manual_pub_ack_test_context_init(&puback_context); struct aws_mqtt5_client_mqtt5_mock_test_fixture_options test_fixture_options = { .client_options = &test_options.client_options, @@ -441,20 +445,21 @@ aws_wait_for_connected_lifecycle_event(&test_context); /* Try to invoke puback with invalid control ID */ - struct aws_mqtt5_manual_puback_completion_options completion_options = { - .completion_callback = s_manual_puback_completion_fn, + struct aws_mqtt5_manual_publish_acknowledgement_completion_options completion_options = { + .completion_callback = s_manual_pub_ack_completion_fn, .completion_user_data = &puback_context, }; uint64_t invalid_control_id = 999999; - ASSERT_SUCCESS(aws_mqtt5_client_invoke_puback(test_context.client, invalid_control_id, &completion_options)); + ASSERT_SUCCESS( + aws_mqtt5_client_invoke_publish_acknowledgement(test_context.client, invalid_control_id, &completion_options)); - s_wait_for_manual_puback_callback(&puback_context); + s_wait_for_manual_pub_ack_callback(&puback_context); /* Verify invalid result */ aws_mutex_lock(&test_context.lock); ASSERT_INT_EQUALS(1, puback_context.puback_result_count); - ASSERT_INT_EQUALS(AWS_MQTT5_MPR_PUBACK_INVALID, puback_context.puback_results[0]); + ASSERT_INT_EQUALS(AWS_MQTT5_MPAR_PUBACK_INVALID, puback_context.puback_results[0]); aws_mutex_unlock(&test_context.lock); ASSERT_SUCCESS(aws_mqtt5_client_stop(test_context.client, NULL, NULL)); @@ -466,16 +471,16 @@ return AWS_OP_SUCCESS; } -AWS_TEST_CASE(mqtt5_client_manual_puback_invalid_control_id, s_mqtt5_client_manual_puback_invalid_control_id_fn) +AWS_TEST_CASE(mqtt5_client_manual_pub_ack_invalid_control_id, s_mqtt5_client_manual_pub_ack_invalid_control_id_fn) /** - * Multiple PUBLISHes with manual PUBACK + * Multiple PUBLISHes with manual publish acknowledgement * - Server sends 3 QoS1 PUBLISHes * - Client acquires control for all 3 * - Client invokes puback for them (in reverse order) * - Verify all succeed */ -static int s_mqtt5_client_manual_puback_multiple_publishes_fn(struct aws_allocator *allocator, void *ctx) { +static int s_mqtt5_client_manual_pub_ack_multiple_publishes_fn(struct aws_allocator *allocator, void *ctx) { (void)ctx; aws_mqtt_library_init(allocator); @@ -483,10 +488,10 @@ struct mqtt5_client_test_options test_options; aws_mqtt5_client_test_init_default_options(&test_options); - struct aws_mqtt5_manual_puback_test_context puback_context; - s_manual_puback_test_context_init(&puback_context); + struct aws_mqtt5_manual_pub_ack_test_context puback_context; + s_manual_pub_ack_test_context_init(&puback_context); - struct aws_mqtt5_server_manual_puback_context server_context = { + struct aws_mqtt5_server_manual_pub_ack_context server_context = { .publish_sent = false, .connack_sent = false, .publishes_to_send = 3, @@ -511,7 +516,7 @@ struct aws_mqtt5_listener_config listener_config = { .client = test_context.client, .listener_callbacks = { - .listener_publish_received_handler = s_manual_puback_publish_received_handler, + .listener_publish_received_handler = s_manual_pub_ack_publish_received_handler, .listener_publish_received_handler_user_data = &puback_context, }}; @@ -521,7 +526,7 @@ aws_wait_for_connected_lifecycle_event(&test_context); /* Wait for all 3 publishes */ - s_wait_for_n_manual_puback_publishes(&puback_context, 3); + s_wait_for_n_manual_pub_ack_publishes(&puback_context, 3); /* Verify we got 3 control IDs */ aws_mutex_lock(&test_context.lock); @@ -529,24 +534,24 @@ aws_mutex_unlock(&test_context.lock); /* Invoke pubacks in reverse order */ - struct aws_mqtt5_manual_puback_completion_options completion_options = { - .completion_callback = s_manual_puback_completion_fn, + struct aws_mqtt5_manual_publish_acknowledgement_completion_options completion_options = { + .completion_callback = s_manual_pub_ack_completion_fn, .completion_user_data = &puback_context, }; for (int i = 2; i >= 0; i--) { - ASSERT_SUCCESS(aws_mqtt5_client_invoke_puback( - test_context.client, puback_context.puback_control_ids[i], &completion_options)); + ASSERT_SUCCESS(aws_mqtt5_client_invoke_publish_acknowledgement( + test_context.client, puback_context.pub_ack_control_ids[i], &completion_options)); } /* Wait for all callbacks */ - s_wait_for_n_manual_puback_callbacks(&puback_context, 3); + s_wait_for_n_manual_pub_ack_callbacks(&puback_context, 3); /* Verify all succeeded */ aws_mutex_lock(&test_context.lock); ASSERT_INT_EQUALS(3, puback_context.puback_result_count); for (size_t i = 0; i < 3; i++) { - ASSERT_INT_EQUALS(AWS_MQTT5_MPR_SUCCESS, puback_context.puback_results[i]); + ASSERT_INT_EQUALS(AWS_MQTT5_MPAR_SUCCESS, puback_context.puback_results[i]); } aws_mutex_unlock(&test_context.lock); @@ -560,17 +565,17 @@ return AWS_OP_SUCCESS; } -AWS_TEST_CASE(mqtt5_client_manual_puback_multiple_publishes, s_mqtt5_client_manual_puback_multiple_publishes_fn) +AWS_TEST_CASE(mqtt5_client_manual_pub_ack_multiple_publishes, s_mqtt5_client_manual_pub_ack_multiple_publishes_fn) /** - * Disconnect cancels pending manual PUBACKs + * Disconnect cancels pending manual publish acknowledgements * - Server sends QoS1 PUBLISH - * - Client acquires manual puback control + * - Client acquires manual publish acknowledgement control * - Disconnect before invoking puback * - Invoke puback after disconnect - * - Verify AWS_MQTT5_MPR_PUBACK_CANCELLED result + * - Verify AWS_MQTT5_MPAR_PUBACK_CANCELLED result */ -static int s_mqtt5_client_manual_puback_disconnect_cancellation_fn(struct aws_allocator *allocator, void *ctx) { +static int s_mqtt5_client_manual_pub_ack_disconnect_cancellation_fn(struct aws_allocator *allocator, void *ctx) { (void)ctx; aws_mqtt_library_init(allocator); @@ -578,10 +583,10 @@ struct mqtt5_client_test_options test_options; aws_mqtt5_client_test_init_default_options(&test_options); - struct aws_mqtt5_manual_puback_test_context puback_context; - s_manual_puback_test_context_init(&puback_context); + struct aws_mqtt5_manual_pub_ack_test_context puback_context; + s_manual_pub_ack_test_context_init(&puback_context); - struct aws_mqtt5_server_manual_puback_context server_context = { + struct aws_mqtt5_server_manual_pub_ack_context server_context = { .publish_sent = false, .connack_sent = false, .publishes_to_send = 1, @@ -606,7 +611,7 @@ struct aws_mqtt5_listener_config listener_config = { .client = test_context.client, .listener_callbacks = { - .listener_publish_received_handler = s_manual_puback_publish_received_handler, + .listener_publish_received_handler = s_manual_pub_ack_publish_received_handler, .listener_publish_received_handler_user_data = &puback_context, }}; @@ -615,10 +620,10 @@ ASSERT_SUCCESS(aws_mqtt5_client_start(test_context.client)); aws_wait_for_connected_lifecycle_event(&test_context); - s_wait_for_manual_puback_publish(&puback_context); + s_wait_for_manual_pub_ack_publish(&puback_context); aws_mutex_lock(&test_context.lock); - uint64_t control_id = puback_context.puback_control_ids[0]; + uint64_t control_id = puback_context.pub_ack_control_ids[0]; aws_mutex_unlock(&test_context.lock); /* Disconnect before invoking puback */ @@ -626,18 +631,19 @@ aws_wait_for_stopped_lifecycle_event(&test_context); /* Now try to invoke puback after disconnect */ - struct aws_mqtt5_manual_puback_completion_options completion_options = { - .completion_callback = s_manual_puback_completion_fn, + struct aws_mqtt5_manual_publish_acknowledgement_completion_options completion_options = { + .completion_callback = s_manual_pub_ack_completion_fn, .completion_user_data = &puback_context, }; - ASSERT_SUCCESS(aws_mqtt5_client_invoke_puback(test_context.client, control_id, &completion_options)); - s_wait_for_manual_puback_callback(&puback_context); + ASSERT_SUCCESS( + aws_mqtt5_client_invoke_publish_acknowledgement(test_context.client, control_id, &completion_options)); + s_wait_for_manual_pub_ack_callback(&puback_context); /* Verify cancelled result */ aws_mutex_lock(&test_context.lock); ASSERT_INT_EQUALS(1, puback_context.puback_result_count); - ASSERT_INT_EQUALS(AWS_MQTT5_MPR_PUBACK_CANCELLED, puback_context.puback_results[0]); + ASSERT_INT_EQUALS(AWS_MQTT5_MPAR_PUBACK_CANCELLED, puback_context.puback_results[0]); aws_mutex_unlock(&test_context.lock); aws_mqtt5_listener_release(listener); @@ -648,5 +654,5 @@ } AWS_TEST_CASE( - mqtt5_client_manual_puback_disconnect_cancellation, - s_mqtt5_client_manual_puback_disconnect_cancellation_fn) \ No newline at end of file + mqtt5_client_manual_pub_ack_disconnect_cancellation, + s_mqtt5_client_manual_pub_ack_disconnect_cancellation_fn) \ No newline at end of file
