@@ -350,7 +350,7 @@ static void s_write_headers(struct aws_byte_buf *dst, const struct aws_http_head
350
350
wrote_all &= aws_byte_buf_write_u8 (dst , '\r' );
351
351
wrote_all &= aws_byte_buf_write_u8 (dst , '\n' );
352
352
}
353
- assert (wrote_all );
353
+ AWS_ASSERT (wrote_all );
354
354
}
355
355
356
356
struct aws_http_stream * s_new_client_request_stream (const struct aws_http_request_options * options ) {
@@ -446,7 +446,7 @@ struct aws_http_stream *s_new_client_request_stream(const struct aws_http_reques
446
446
wrote_all &= aws_byte_buf_write_u8 (& stream -> outgoing_head_buf , '\r' );
447
447
wrote_all &= aws_byte_buf_write_u8 (& stream -> outgoing_head_buf , '\n' );
448
448
(void )wrote_all ;
449
- assert (wrote_all );
449
+ AWS_ASSERT (wrote_all );
450
450
451
451
/* Insert new stream into pending list, and schedule outgoing_stream_task if it's not already running. */
452
452
bool is_shutting_down = false;
@@ -634,7 +634,7 @@ static void s_stream_write_outgoing_data(struct h1_stream *stream, struct aws_io
634
634
635
635
bool success = aws_byte_buf_write (dst , src -> buffer + src_progress , transferring );
636
636
(void )success ;
637
- assert (success );
637
+ AWS_ASSERT (success );
638
638
639
639
stream -> outgoing_head_progress += transferring ;
640
640
@@ -785,7 +785,7 @@ static struct h1_stream *s_update_outgoing_stream_ptr(struct h1_connection *conn
785
785
/* If it's also done receiving data, then it's complete! */
786
786
if (current -> is_incoming_message_done ) {
787
787
/* Only 1st stream in list could finish receiving before it finished sending */
788
- assert (& current -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
788
+ AWS_ASSERT (& current -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
789
789
790
790
/* This removes stream from list */
791
791
s_stream_complete (current , AWS_ERROR_SUCCESS );
@@ -969,8 +969,8 @@ static int s_decoder_on_request(
969
969
struct h1_connection * connection = user_data ;
970
970
struct h1_stream * incoming_stream = connection -> thread_data .incoming_stream ;
971
971
972
- assert (incoming_stream -> base .incoming_request_method_str .len == 0 );
973
- assert (incoming_stream -> base .incoming_request_uri .len == 0 );
972
+ AWS_ASSERT (incoming_stream -> base .incoming_request_method_str .len == 0 );
973
+ AWS_ASSERT (incoming_stream -> base .incoming_request_uri .len == 0 );
974
974
975
975
AWS_LOGF_TRACE (
976
976
AWS_LS_HTTP_STREAM ,
@@ -981,7 +981,7 @@ static int s_decoder_on_request(
981
981
982
982
/* Copy strings to internal buffer */
983
983
struct aws_byte_buf * storage_buf = & incoming_stream -> incoming_storage_buf ;
984
- assert (storage_buf -> capacity == 0 );
984
+ AWS_ASSERT (storage_buf -> capacity == 0 );
985
985
986
986
size_t storage_size = 0 ;
987
987
int err = aws_add_size_checked (uri -> len , method_str -> len , & storage_size );
@@ -1098,7 +1098,7 @@ static int s_decoder_on_body(const struct aws_byte_cursor *data, bool finished,
1098
1098
1099
1099
struct h1_connection * connection = user_data ;
1100
1100
struct h1_stream * incoming_stream = connection -> thread_data .incoming_stream ;
1101
- assert (incoming_stream );
1101
+ AWS_ASSERT (incoming_stream );
1102
1102
1103
1103
int err = s_mark_head_done (incoming_stream );
1104
1104
if (err ) {
@@ -1117,7 +1117,7 @@ static int s_decoder_on_body(const struct aws_byte_cursor *data, bool finished,
1117
1117
/* If user reduced window_update_size, reduce how much the connection will update its window. */
1118
1118
if (window_update_size < data -> len ) {
1119
1119
size_t reduce = data -> len - window_update_size ;
1120
- assert (reduce <= connection -> thread_data .incoming_message_window_update );
1120
+ AWS_ASSERT (reduce <= connection -> thread_data .incoming_message_window_update );
1121
1121
connection -> thread_data .incoming_message_window_update -= reduce ;
1122
1122
1123
1123
AWS_LOGF_DEBUG (
@@ -1139,7 +1139,7 @@ static int s_decoder_on_body(const struct aws_byte_cursor *data, bool finished,
1139
1139
static int s_decoder_on_done (void * user_data ) {
1140
1140
struct h1_connection * connection = user_data ;
1141
1141
struct h1_stream * incoming_stream = connection -> thread_data .incoming_stream ;
1142
- assert (incoming_stream );
1142
+ AWS_ASSERT (incoming_stream );
1143
1143
1144
1144
/* Ensure head was marked done */
1145
1145
int err = s_mark_head_done (incoming_stream );
@@ -1150,7 +1150,7 @@ static int s_decoder_on_done(void *user_data) {
1150
1150
incoming_stream -> is_incoming_message_done = true;
1151
1151
1152
1152
if (incoming_stream -> outgoing_state == STREAM_OUTGOING_STATE_DONE ) {
1153
- assert (& incoming_stream -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
1153
+ AWS_ASSERT (& incoming_stream -> node == aws_linked_list_begin (& connection -> thread_data .stream_list ));
1154
1154
1155
1155
s_stream_complete (incoming_stream , AWS_ERROR_SUCCESS );
1156
1156
@@ -1260,8 +1260,8 @@ static void s_handler_destroy(struct aws_channel_handler *handler) {
1260
1260
1261
1261
AWS_LOGF_TRACE (AWS_LS_HTTP_CONNECTION , "id=%p: Destroying connection." , (void * )& connection -> base );
1262
1262
1263
- assert (aws_linked_list_empty (& connection -> thread_data .stream_list ));
1264
- assert (aws_linked_list_empty (& connection -> synced_data .pending_stream_list ));
1263
+ AWS_ASSERT (aws_linked_list_empty (& connection -> thread_data .stream_list ));
1264
+ AWS_ASSERT (aws_linked_list_empty (& connection -> synced_data .pending_stream_list ));
1265
1265
1266
1266
aws_http_decoder_destroy (connection -> thread_data .incoming_stream_decoder );
1267
1267
aws_mutex_clean_up (& connection -> synced_data .lock );
@@ -1366,7 +1366,7 @@ static int s_handler_process_write_message(
1366
1366
(void )handler ;
1367
1367
(void )slot ;
1368
1368
(void )message ;
1369
- assert (false); /* Should not be called until websocket stuff comes along. */
1369
+ AWS_ASSERT (false); /* Should not be called until websocket stuff comes along. */
1370
1370
return aws_raise_error (AWS_ERROR_UNIMPLEMENTED );
1371
1371
}
1372
1372
@@ -1378,7 +1378,7 @@ static int s_handler_increment_read_window(
1378
1378
(void )handler ;
1379
1379
(void )slot ;
1380
1380
(void )size ;
1381
- assert (false); /* Should not be called until websocket stuff comes along. */
1381
+ AWS_ASSERT (false); /* Should not be called until websocket stuff comes along. */
1382
1382
return aws_raise_error (AWS_ERROR_UNIMPLEMENTED );
1383
1383
}
1384
1384
0 commit comments