diff --git a/devdoc/channel_requirements.md b/devdoc/channel_requirements.md index f40732ac..9cd1f70a 100644 --- a/devdoc/channel_requirements.md +++ b/devdoc/channel_requirements.md @@ -305,8 +305,8 @@ channel_open` opens the given `channel`. **SRS_CHANNEL_43_148: [** If `channel_op_context` is `NULL`, `execute_callbacks` shall terminate the process. **]** -**SRS_CHANNEL_43_157: [** `execute_callbacks` shall call `sm_exec_end` for each callback that is called. **]** - **SRS_CHANNEL_43_145: [** `execute_callbacks` shall call the stored callback(s) with the `result` of the `operation`. **]** +**SRS_CHANNEL_43_157: [** `execute_callbacks` shall call `sm_exec_end` for each callback that is called. **]** + **SRS_CHANNEL_43_147: [** `execute_callbacks` shall perform cleanup of the `operation`. **]** diff --git a/src/channel.c b/src/channel.c index f84fb978..3f336add 100644 --- a/src/channel.c +++ b/src/channel.c @@ -256,24 +256,24 @@ static void execute_callbacks(void* context) if (channel_op->on_data_available_cb != NULL) { - /*Codes_SRS_CHANNEL_43_157: [ execute_callbacks shall call sm_exec_end for each callback that is called. ]*/ - sm_exec_end(channel_op->channel->sm); + /*Codes_SRS_CHANNEL_43_145: [ execute_callbacks shall call the stored callback(s) with the result of the operation. ]*/ + channel_op->on_data_available_cb(channel_op->on_data_available_context, result, channel_op->pull_correlation_id, channel_op->push_correlation_id, channel_op->data); } if (channel_op->on_data_consumed_cb != NULL) { - /*Codes_SRS_CHANNEL_43_157: [ execute_callbacks shall call sm_exec_end for each callback that is called. ]*/ - sm_exec_end(channel_op->channel->sm); + /*Codes_SRS_CHANNEL_43_145: [ execute_callbacks shall call the stored callback(s) with the result of the operation. ]*/ + channel_op->on_data_consumed_cb(channel_op->on_data_consumed_context, result, channel_op->pull_correlation_id, channel_op->push_correlation_id); } if (channel_op->on_data_available_cb != NULL) { - /*Codes_SRS_CHANNEL_43_145: [ execute_callbacks shall call the stored callback(s) with the result of the operation. ]*/ - channel_op->on_data_available_cb(channel_op->on_data_available_context, result, channel_op->pull_correlation_id, channel_op->push_correlation_id, channel_op->data); + /*Codes_SRS_CHANNEL_43_157: [ execute_callbacks shall call sm_exec_end for each callback that is called. ]*/ + sm_exec_end(channel_op->channel->sm); } if (channel_op->on_data_consumed_cb != NULL) { - /*Codes_SRS_CHANNEL_43_145: [ execute_callbacks shall call the stored callback(s) with the result of the operation. ]*/ - channel_op->on_data_consumed_cb(channel_op->on_data_consumed_context, result, channel_op->pull_correlation_id, channel_op->push_correlation_id); + /*Codes_SRS_CHANNEL_43_157: [ execute_callbacks shall call sm_exec_end for each callback that is called. ]*/ + sm_exec_end(channel_op->channel->sm); } /*Codes_SRS_CHANNEL_43_147: [ execute_callbacks shall perform cleanup of the operation. ]*/