Skip to content

Commit

Permalink
comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK committed Jul 24, 2024
1 parent 8f212e5 commit 9867c55
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions source/windows/secure_channel_tls_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ static int s_process_pending_output_messages(struct aws_channel_handler *handler
if (sc_handler->slot->adj_right) {
downstream_window = aws_channel_slot_downstream_read_window(sc_handler->slot);
}
int ret = AWS_OP_ERR;

AWS_LOGF_TRACE(
AWS_LS_IO_TLS,
Expand Down Expand Up @@ -1206,7 +1207,7 @@ static int s_process_pending_output_messages(struct aws_channel_handler *handler
}
if (aws_channel_slot_send_message(sc_handler->slot, read_out_msg, AWS_CHANNEL_DIR_READ)) {
aws_mem_release(read_out_msg->allocator, read_out_msg);
return AWS_OP_ERR;
goto done;
}

if (sc_handler->slot->adj_right) {
Expand All @@ -1221,15 +1222,21 @@ static int s_process_pending_output_messages(struct aws_channel_handler *handler
sc_handler->buffered_read_out_data_buf.len = 0;
}
}
if (sc_handler->buffered_read_out_data_buf.len == 0 &&
sc_handler->read_state == AWS_TLS_HANDLER_READ_SHUTTING_DOWN) {
ret = AWS_OP_SUCCESS;
if (sc_handler->buffered_read_out_data_buf.len > 0) {
/* Still have more data to be delivered */
return ret;
}

done:
if (sc_handler->read_state == AWS_TLS_HANDLER_READ_SHUTTING_DOWN) {
sc_handler->read_state = AWS_TLS_HANDLER_READ_SHUT_DOWN_COMPLETE;
/* Continue the shutdown process delayed before. */
aws_channel_slot_on_handler_shutdown_complete(
sc_handler->slot, AWS_CHANNEL_DIR_READ, sc_handler->shutdown_error_code, false);
}

return AWS_OP_SUCCESS;
return ret;
}

static void s_process_pending_output_task(struct aws_channel_task *task, void *arg, enum aws_task_status status) {
Expand Down

0 comments on commit 9867c55

Please sign in to comment.