@@ -637,7 +637,7 @@ static void s_stream_complete(struct aws_h1_stream *stream, int error_code) {
637
637
}
638
638
639
639
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 ) {
641
641
/* As a request that finished receiving the response, we ignore error and
642
642
* consider it finished successfully */
643
643
AWS_LOGF_DEBUG (
@@ -649,7 +649,7 @@ static void s_stream_complete(struct aws_h1_stream *stream, int error_code) {
649
649
aws_error_name (error_code ));
650
650
error_code = AWS_ERROR_SUCCESS ;
651
651
}
652
- if (stream -> base .server_data && stream -> is_outgoing_message_done ) {
652
+ if (stream -> base .server_data && stream -> thread_data . is_outgoing_message_done ) {
653
653
/* As a server finished sending the response, but still failed with the request was not finished receiving.
654
654
* We ignore error and consider it finished successfully */
655
655
AWS_LOGF_DEBUG (
@@ -693,7 +693,7 @@ static void s_stream_complete(struct aws_h1_stream *stream, int error_code) {
693
693
694
694
/* If connection must shut down, do it BEFORE invoking stream-complete callback.
695
695
* 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 ) {
697
697
AWS_LOGF_TRACE (
698
698
AWS_LS_HTTP_CONNECTION ,
699
699
"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) {
845
845
struct aws_channel * channel = aws_http_connection_get_channel (connection );
846
846
AWS_ASSERT (aws_channel_thread_is_callers_thread (channel ));
847
847
848
- if (stream -> is_outgoing_message_done ) {
848
+ if (stream -> thread_data . is_outgoing_message_done ) {
849
849
/* Already did the job */
850
850
return ;
851
851
}
852
852
853
- stream -> is_outgoing_message_done = true;
853
+ stream -> thread_data . is_outgoing_message_done = true;
854
854
AWS_ASSERT (stream -> base .metrics .send_end_timestamp_ns == -1 );
855
855
aws_high_res_clock_get_ticks ((uint64_t * )& stream -> base .metrics .send_end_timestamp_ns );
856
856
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
904
904
905
905
/* RFC-7230 section 6.6: Tear-down.
906
906
* 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 ) {
908
908
AWS_LOGF_TRACE (
909
909
AWS_LS_HTTP_CONNECTION ,
910
910
"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
919
919
}
920
920
921
921
/* 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 ) {
923
923
/* Only 1st stream in list could finish receiving before it finished sending */
924
924
AWS_ASSERT (& current -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
925
925
@@ -942,7 +942,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct aws_h1_connecti
942
942
struct aws_h1_stream * stream = AWS_CONTAINER_OF (node , struct aws_h1_stream , node );
943
943
944
944
/* 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 ) {
946
946
continue ;
947
947
}
948
948
@@ -975,7 +975,7 @@ static struct aws_h1_stream *s_update_outgoing_stream_ptr(struct aws_h1_connecti
975
975
aws_high_res_clock_get_ticks ((uint64_t * )& current -> base .metrics .send_start_timestamp_ns );
976
976
977
977
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 );
979
979
(void )err ;
980
980
AWS_ASSERT (connection -> thread_data .encoder .state == AWS_H1_ENCODER_STATE_INIT );
981
981
AWS_ASSERT (!err );
@@ -1177,7 +1177,7 @@ static int s_decoder_on_request(
1177
1177
AWS_BYTE_CURSOR_PRI (* uri ));
1178
1178
1179
1179
/* 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 ;
1181
1181
AWS_ASSERT (storage_buf -> capacity == 0 );
1182
1182
1183
1183
size_t storage_size = 0 ;
@@ -1261,7 +1261,7 @@ static int s_decoder_on_header(const struct aws_h1_decoded_header *header, void
1261
1261
"id=%p: Received 'Connection: close' header. This will be the final stream on this connection." ,
1262
1262
(void * )& incoming_stream -> base );
1263
1263
1264
- incoming_stream -> is_final_stream = true;
1264
+ incoming_stream -> thread_data . is_final_stream = true;
1265
1265
{ /* BEGIN CRITICAL SECTION */
1266
1266
aws_h1_connection_lock_synced_data (connection );
1267
1267
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
1278
1278
* Mark the stream's outgoing message as complete,
1279
1279
* so that we stop sending, and stop waiting for it to finish sending.
1280
1280
**/
1281
- if (!incoming_stream -> is_outgoing_message_done ) {
1281
+ if (!incoming_stream -> thread_data . is_outgoing_message_done ) {
1282
1282
AWS_LOGF_DEBUG (
1283
1283
AWS_LS_HTTP_STREAM ,
1284
1284
"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
1323
1323
1324
1324
static int s_mark_head_done (struct aws_h1_stream * incoming_stream ) {
1325
1325
/* 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 ) {
1327
1327
return AWS_OP_SUCCESS ;
1328
1328
}
1329
1329
@@ -1335,7 +1335,7 @@ static int s_mark_head_done(struct aws_h1_stream *incoming_stream) {
1335
1335
1336
1336
if (header_block == AWS_HTTP_HEADER_BLOCK_MAIN ) {
1337
1337
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;
1339
1339
1340
1340
} else if (header_block == AWS_HTTP_HEADER_BLOCK_INFORMATIONAL ) {
1341
1341
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) {
1443
1443
}
1444
1444
1445
1445
/* 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;
1447
1447
aws_high_res_clock_get_ticks ((uint64_t * )& incoming_stream -> base .metrics .receive_end_timestamp_ns );
1448
1448
AWS_ASSERT (incoming_stream -> base .metrics .receive_start_timestamp_ns != -1 );
1449
1449
AWS_ASSERT (
@@ -1454,7 +1454,7 @@ static int s_decoder_on_done(void *user_data) {
1454
1454
1455
1455
/* RFC-7230 section 6.6
1456
1456
* 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 ) {
1458
1458
AWS_LOGF_TRACE (
1459
1459
AWS_LS_HTTP_CONNECTION ,
1460
1460
"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) {
1479
1479
return AWS_OP_ERR ;
1480
1480
}
1481
1481
}
1482
- if (incoming_stream -> is_outgoing_message_done ) {
1482
+ if (incoming_stream -> thread_data . is_outgoing_message_done ) {
1483
1483
AWS_ASSERT (& incoming_stream -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
1484
1484
s_stream_complete (incoming_stream , AWS_ERROR_SUCCESS );
1485
1485
}
1486
1486
s_set_incoming_stream_ptr (connection , NULL );
1487
1487
1488
- } else if (incoming_stream -> is_outgoing_message_done ) {
1488
+ } else if (incoming_stream -> thread_data . is_outgoing_message_done ) {
1489
1489
/* Client side */
1490
1490
AWS_ASSERT (& incoming_stream -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
1491
1491
0 commit comments