@@ -350,7 +350,7 @@ static void s_write_headers(struct aws_byte_buf *dst, const struct aws_http_head
350350 wrote_all &= aws_byte_buf_write_u8 (dst , '\r' );
351351 wrote_all &= aws_byte_buf_write_u8 (dst , '\n' );
352352 }
353- assert (wrote_all );
353+ AWS_ASSERT (wrote_all );
354354}
355355
356356struct 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
446446 wrote_all &= aws_byte_buf_write_u8 (& stream -> outgoing_head_buf , '\r' );
447447 wrote_all &= aws_byte_buf_write_u8 (& stream -> outgoing_head_buf , '\n' );
448448 (void )wrote_all ;
449- assert (wrote_all );
449+ AWS_ASSERT (wrote_all );
450450
451451 /* Insert new stream into pending list, and schedule outgoing_stream_task if it's not already running. */
452452 bool is_shutting_down = false;
@@ -634,7 +634,7 @@ static void s_stream_write_outgoing_data(struct h1_stream *stream, struct aws_io
634634
635635 bool success = aws_byte_buf_write (dst , src -> buffer + src_progress , transferring );
636636 (void )success ;
637- assert (success );
637+ AWS_ASSERT (success );
638638
639639 stream -> outgoing_head_progress += transferring ;
640640
@@ -785,7 +785,7 @@ static struct h1_stream *s_update_outgoing_stream_ptr(struct h1_connection *conn
785785 /* If it's also done receiving data, then it's complete! */
786786 if (current -> is_incoming_message_done ) {
787787 /* 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 ));
789789
790790 /* This removes stream from list */
791791 s_stream_complete (current , AWS_ERROR_SUCCESS );
@@ -969,8 +969,8 @@ static int s_decoder_on_request(
969969 struct h1_connection * connection = user_data ;
970970 struct h1_stream * incoming_stream = connection -> thread_data .incoming_stream ;
971971
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 );
974974
975975 AWS_LOGF_TRACE (
976976 AWS_LS_HTTP_STREAM ,
@@ -981,7 +981,7 @@ static int s_decoder_on_request(
981981
982982 /* Copy strings to internal buffer */
983983 struct aws_byte_buf * storage_buf = & incoming_stream -> incoming_storage_buf ;
984- assert (storage_buf -> capacity == 0 );
984+ AWS_ASSERT (storage_buf -> capacity == 0 );
985985
986986 size_t storage_size = 0 ;
987987 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,
10981098
10991099 struct h1_connection * connection = user_data ;
11001100 struct h1_stream * incoming_stream = connection -> thread_data .incoming_stream ;
1101- assert (incoming_stream );
1101+ AWS_ASSERT (incoming_stream );
11021102
11031103 int err = s_mark_head_done (incoming_stream );
11041104 if (err ) {
@@ -1117,7 +1117,7 @@ static int s_decoder_on_body(const struct aws_byte_cursor *data, bool finished,
11171117 /* If user reduced window_update_size, reduce how much the connection will update its window. */
11181118 if (window_update_size < data -> len ) {
11191119 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 );
11211121 connection -> thread_data .incoming_message_window_update -= reduce ;
11221122
11231123 AWS_LOGF_DEBUG (
@@ -1139,7 +1139,7 @@ static int s_decoder_on_body(const struct aws_byte_cursor *data, bool finished,
11391139static int s_decoder_on_done (void * user_data ) {
11401140 struct h1_connection * connection = user_data ;
11411141 struct h1_stream * incoming_stream = connection -> thread_data .incoming_stream ;
1142- assert (incoming_stream );
1142+ AWS_ASSERT (incoming_stream );
11431143
11441144 /* Ensure head was marked done */
11451145 int err = s_mark_head_done (incoming_stream );
@@ -1150,7 +1150,7 @@ static int s_decoder_on_done(void *user_data) {
11501150 incoming_stream -> is_incoming_message_done = true;
11511151
11521152 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 ));
11541154
11551155 s_stream_complete (incoming_stream , AWS_ERROR_SUCCESS );
11561156
@@ -1260,8 +1260,8 @@ static void s_handler_destroy(struct aws_channel_handler *handler) {
12601260
12611261 AWS_LOGF_TRACE (AWS_LS_HTTP_CONNECTION , "id=%p: Destroying connection." , (void * )& connection -> base );
12621262
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 ));
12651265
12661266 aws_http_decoder_destroy (connection -> thread_data .incoming_stream_decoder );
12671267 aws_mutex_clean_up (& connection -> synced_data .lock );
@@ -1366,7 +1366,7 @@ static int s_handler_process_write_message(
13661366 (void )handler ;
13671367 (void )slot ;
13681368 (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. */
13701370 return aws_raise_error (AWS_ERROR_UNIMPLEMENTED );
13711371}
13721372
@@ -1378,7 +1378,7 @@ static int s_handler_increment_read_window(
13781378 (void )handler ;
13791379 (void )slot ;
13801380 (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. */
13821382 return aws_raise_error (AWS_ERROR_UNIMPLEMENTED );
13831383}
13841384
0 commit comments