@@ -276,7 +276,7 @@ static int s_state_payload(struct aws_websocket_decoder *decoder, struct aws_byt
276276
277277 /* Validate the UTF-8 for TEXT messages (a TEXT frame and any subsequent CONTINUATION frames) */
278278 if (decoder -> processing_text_message && aws_websocket_is_data_frame (decoder -> current_frame .opcode )) {
279- if (aws_utf8_validator_update (decoder -> text_message_validator , payload )) {
279+ if (aws_utf8_decoder_update (decoder -> text_message_validator , payload )) {
280280 AWS_LOGF_ERROR (AWS_LS_HTTP_WEBSOCKET , "id=%p: Received invalid UTF-8" , (void * )decoder -> user_data );
281281 return aws_raise_error (AWS_ERROR_HTTP_WEBSOCKET_PROTOCOL_ERROR );
282282 }
@@ -308,7 +308,7 @@ static int s_state_frame_end(struct aws_websocket_decoder *decoder, struct aws_b
308308 if (decoder -> processing_text_message && aws_websocket_is_data_frame (decoder -> current_frame .opcode ) &&
309309 decoder -> current_frame .fin ) {
310310
311- if (aws_utf8_validator_finalize (decoder -> text_message_validator )) {
311+ if (aws_utf8_decoder_finalize (decoder -> text_message_validator )) {
312312 AWS_LOGF_ERROR (
313313 AWS_LS_HTTP_WEBSOCKET ,
314314 "id=%p: Received invalid UTF-8 (incomplete encoding)" ,
@@ -378,10 +378,10 @@ void aws_websocket_decoder_init(
378378 decoder -> user_data = user_data ;
379379 decoder -> on_frame = on_frame ;
380380 decoder -> on_payload = on_payload ;
381- decoder -> text_message_validator = aws_utf8_validator_new (alloc );
381+ decoder -> text_message_validator = aws_utf8_decoder_new (alloc , NULL /*options*/ );
382382}
383383
384384void aws_websocket_decoder_clean_up (struct aws_websocket_decoder * decoder ) {
385- aws_utf8_validator_destroy (decoder -> text_message_validator );
385+ aws_utf8_decoder_destroy (decoder -> text_message_validator );
386386 AWS_ZERO_STRUCT (* decoder );
387387}
0 commit comments