@@ -637,7 +637,7 @@ static void s_stream_complete(struct aws_h1_stream *stream, int error_code) {
637637 }
638638
639639 if (error_code != AWS_ERROR_SUCCESS ) {
640- if (stream -> base .client_data && stream -> is_incoming_message_done ) {
640+ if (stream -> base .client_data && stream -> thread_data . is_incoming_message_done ) {
641641 /* As a request that finished receiving the response, we ignore error and
642642 * consider it finished successfully */
643643 AWS_LOGF_DEBUG (
@@ -649,7 +649,7 @@ static void s_stream_complete(struct aws_h1_stream *stream, int error_code) {
649649 aws_error_name (error_code ));
650650 error_code = AWS_ERROR_SUCCESS ;
651651 }
652- if (stream -> base .server_data && stream -> is_outgoing_message_done ) {
652+ if (stream -> base .server_data && stream -> thread_data . is_outgoing_message_done ) {
653653 /* As a server finished sending the response, but still failed with the request was not finished receiving.
654654 * We ignore error and consider it finished successfully */
655655 AWS_LOGF_DEBUG (
@@ -693,7 +693,7 @@ static void s_stream_complete(struct aws_h1_stream *stream, int error_code) {
693693
694694 /* If connection must shut down, do it BEFORE invoking stream-complete callback.
695695 * That way, if aws_http_connection_is_open() is called from stream-complete callback, it returns false. */
696- if (stream -> is_final_stream ) {
696+ if (stream -> thread_data . is_final_stream ) {
697697 AWS_LOGF_TRACE (
698698 AWS_LS_HTTP_CONNECTION ,
699699 "id=%p: Closing connection due to completion of final stream." ,
@@ -845,12 +845,12 @@ static void s_set_outgoing_message_done(struct aws_h1_stream *stream) {
845845 struct aws_channel * channel = aws_http_connection_get_channel (connection );
846846 AWS_ASSERT (aws_channel_thread_is_callers_thread (channel ));
847847
848- if (stream -> is_outgoing_message_done ) {
848+ if (stream -> thread_data . is_outgoing_message_done ) {
849849 /* Already did the job */
850850 return ;
851851 }
852852
853- stream -> is_outgoing_message_done = true;
853+ stream -> thread_data . is_outgoing_message_done = true;
854854 AWS_ASSERT (stream -> base .metrics .send_end_timestamp_ns == -1 );
855855 aws_high_res_clock_get_ticks ((uint64_t * )& stream -> base .metrics .send_end_timestamp_ns );
856856 AWS_ASSERT (stream -> base .metrics .send_start_timestamp_ns != -1 );
@@ -904,7 +904,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct aws_h1_connecti
904904
905905 /* RFC-7230 section 6.6: Tear-down.
906906 * If this was the final stream, don't allows any further streams to be sent */
907- if (current -> is_final_stream ) {
907+ if (current -> thread_data . is_final_stream ) {
908908 AWS_LOGF_TRACE (
909909 AWS_LS_HTTP_CONNECTION ,
910910 "id=%p: Done sending final stream, no further streams will be sent." ,
@@ -919,7 +919,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct aws_h1_connecti
919919 }
920920
921921 /* If it's also done receiving data, then it's complete! */
922- if (current -> is_incoming_message_done ) {
922+ if (current -> thread_data . is_incoming_message_done ) {
923923 /* Only 1st stream in list could finish receiving before it finished sending */
924924 AWS_ASSERT (& current -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
925925
@@ -942,7 +942,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct aws_h1_connecti
942942 struct aws_h1_stream * stream = AWS_CONTAINER_OF (node , struct aws_h1_stream , node );
943943
944944 /* If we already sent this stream's data, keep looking... */
945- if (stream -> is_outgoing_message_done ) {
945+ if (stream -> thread_data . is_outgoing_message_done ) {
946946 continue ;
947947 }
948948
@@ -975,7 +975,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct aws_h1_connecti
975975 aws_high_res_clock_get_ticks ((uint64_t * )& current -> base .metrics .send_start_timestamp_ns );
976976
977977 err = aws_h1_encoder_start_message (
978- & connection -> thread_data .encoder , & current -> encoder_message , & current -> base );
978+ & connection -> thread_data .encoder , & current -> thread_data . encoder_message , & current -> base );
979979 (void )err ;
980980 AWS_ASSERT (connection -> thread_data .encoder .state == AWS_H1_ENCODER_STATE_INIT );
981981 AWS_ASSERT (!err );
@@ -1177,7 +1177,7 @@ static int s_decoder_on_request(
11771177 AWS_BYTE_CURSOR_PRI (* uri ));
11781178
11791179 /* Copy strings to internal buffer */
1180- struct aws_byte_buf * storage_buf = & incoming_stream -> incoming_storage_buf ;
1180+ struct aws_byte_buf * storage_buf = & incoming_stream -> thread_data . incoming_storage_buf ;
11811181 AWS_ASSERT (storage_buf -> capacity == 0 );
11821182
11831183 size_t storage_size = 0 ;
@@ -1261,7 +1261,7 @@ static int s_decoder_on_header(const struct aws_h1_decoded_header *header, void
12611261 "id=%p: Received 'Connection: close' header. This will be the final stream on this connection." ,
12621262 (void * )& incoming_stream -> base );
12631263
1264- incoming_stream -> is_final_stream = true;
1264+ incoming_stream -> thread_data . is_final_stream = true;
12651265 { /* BEGIN CRITICAL SECTION */
12661266 aws_h1_connection_lock_synced_data (connection );
12671267 connection -> synced_data .new_stream_error_code = AWS_ERROR_HTTP_CONNECTION_CLOSED ;
@@ -1278,7 +1278,7 @@ static int s_decoder_on_header(const struct aws_h1_decoded_header *header, void
12781278 * Mark the stream's outgoing message as complete,
12791279 * so that we stop sending, and stop waiting for it to finish sending.
12801280 **/
1281- if (!incoming_stream -> is_outgoing_message_done ) {
1281+ if (!incoming_stream -> thread_data . is_outgoing_message_done ) {
12821282 AWS_LOGF_DEBUG (
12831283 AWS_LS_HTTP_STREAM ,
12841284 "id=%p: Received 'Connection: close' header, no more request data will be sent." ,
@@ -1323,7 +1323,7 @@ static int s_decoder_on_header(const struct aws_h1_decoded_header *header, void
13231323
13241324static int s_mark_head_done (struct aws_h1_stream * incoming_stream ) {
13251325 /* Bail out if we've already done this */
1326- if (incoming_stream -> is_incoming_head_done ) {
1326+ if (incoming_stream -> thread_data . is_incoming_head_done ) {
13271327 return AWS_OP_SUCCESS ;
13281328 }
13291329
@@ -1335,7 +1335,7 @@ static int s_mark_head_done(struct aws_h1_stream *incoming_stream) {
13351335
13361336 if (header_block == AWS_HTTP_HEADER_BLOCK_MAIN ) {
13371337 AWS_LOGF_TRACE (AWS_LS_HTTP_STREAM , "id=%p: Main header block done." , (void * )& incoming_stream -> base );
1338- incoming_stream -> is_incoming_head_done = true;
1338+ incoming_stream -> thread_data . is_incoming_head_done = true;
13391339
13401340 } else if (header_block == AWS_HTTP_HEADER_BLOCK_INFORMATIONAL ) {
13411341 AWS_LOGF_TRACE (AWS_LS_HTTP_STREAM , "id=%p: Informational header block done." , (void * )& incoming_stream -> base );
@@ -1443,7 +1443,7 @@ static int s_decoder_on_done(void *user_data) {
14431443 }
14441444
14451445 /* Otherwise the incoming stream is finished decoding and we will update it if needed */
1446- incoming_stream -> is_incoming_message_done = true;
1446+ incoming_stream -> thread_data . is_incoming_message_done = true;
14471447 aws_high_res_clock_get_ticks ((uint64_t * )& incoming_stream -> base .metrics .receive_end_timestamp_ns );
14481448 AWS_ASSERT (incoming_stream -> base .metrics .receive_start_timestamp_ns != -1 );
14491449 AWS_ASSERT (
@@ -1454,7 +1454,7 @@ static int s_decoder_on_done(void *user_data) {
14541454
14551455 /* RFC-7230 section 6.6
14561456 * After reading the final message, the connection must not read any more */
1457- if (incoming_stream -> is_final_stream ) {
1457+ if (incoming_stream -> thread_data . is_final_stream ) {
14581458 AWS_LOGF_TRACE (
14591459 AWS_LS_HTTP_CONNECTION ,
14601460 "id=%p: Done reading final stream, no further streams will be read." ,
@@ -1479,13 +1479,13 @@ static int s_decoder_on_done(void *user_data) {
14791479 return AWS_OP_ERR ;
14801480 }
14811481 }
1482- if (incoming_stream -> is_outgoing_message_done ) {
1482+ if (incoming_stream -> thread_data . is_outgoing_message_done ) {
14831483 AWS_ASSERT (& incoming_stream -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
14841484 s_stream_complete (incoming_stream , AWS_ERROR_SUCCESS );
14851485 }
14861486 s_set_incoming_stream_ptr (connection , NULL );
14871487
1488- } else if (incoming_stream -> is_outgoing_message_done ) {
1488+ } else if (incoming_stream -> thread_data . is_outgoing_message_done ) {
14891489 /* Client side */
14901490 AWS_ASSERT (& incoming_stream -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
14911491
0 commit comments