@@ -249,11 +249,14 @@ lws_qpack_encode_string(unsigned char *buf, size_t buf_len, const char *str, siz
249249 return (int )(pos + len );
250250}
251251
252+ #if 0
252253static struct lws_qpack_tx_table_entry *
253254lws_qpack_tx_find (struct lws_qpack_tx_encoder * enc , const char * name , size_t name_len , const char * val , size_t val_len );
254255
255256static int
256257lws_qpack_tx_insert (struct lws_qpack_tx_encoder * enc , const char * name , size_t name_len , const char * val , size_t val_len , int static_name_idx );
258+ #endif
259+
257260
258261LWS_VISIBLE int
259262lws_qpack_encode_prefix (unsigned char * buf , size_t buf_len , uint64_t ric , uint64_t base , uint64_t max_entries )
@@ -344,7 +347,6 @@ lws_add_http3_header_by_name(struct lws *wsi, const unsigned char *name,
344347 int name_len = (int )strlen ((const char * )name );
345348 int n ;
346349 char lower_name [256 ];
347- struct lws_qpack_tx_encoder * enc = wsi ? wsi -> h3 .qpack_tx_encoder : NULL ;
348350
349351 if (name_len && name [name_len - 1 ] == ':' )
350352 name_len -- ;
@@ -354,30 +356,6 @@ lws_add_http3_header_by_name(struct lws *wsi, const unsigned char *name,
354356 lower_name [n ] = (char )tolower ((int )name [n ]);
355357 lower_name [name_len ] = '\0' ;
356358
357- if (enc ) {
358- struct lws_qpack_tx_table_entry * dte = lws_qpack_tx_find (enc , lower_name , (size_t )name_len , (const char * )value , (size_t )length );
359- if (dte ) {
360- if (dte -> insert_index + 1 > wsi -> http .h3_req_ric )
361- wsi -> http .h3_req_ric = dte -> insert_index + 1 ;
362- n = lws_qpack_tx_encode_dynamic_index (* p , lws_ptr_diff_size_t (end , * p ), dte -> insert_index , wsi -> http .h3_base );
363- if (n >= 0 ) {
364- * p += n ;
365- return 0 ;
366- }
367- }
368-
369- int new_idx = lws_qpack_tx_insert (enc , lower_name , (size_t )name_len , (const char * )value , (size_t )length , -1 );
370- if (new_idx >= 0 ) {
371- if ((uint32_t )new_idx + 1 > wsi -> http .h3_req_ric )
372- wsi -> http .h3_req_ric = (uint32_t )new_idx + 1 ;
373- n = lws_qpack_tx_encode_dynamic_name_ref (* p , lws_ptr_diff_size_t (end , * p ), (uint32_t )new_idx , wsi -> http .h3_base , (const char * )value , (size_t )length );
374- if (n >= 0 ) {
375- * p += n ;
376- return 0 ;
377- }
378- }
379- }
380-
381359 n = lws_qpack_encode_literal_with_literal_name (* p , lws_ptr_diff_size_t (end , * p ), lower_name , (size_t )name_len , (const char * )value , (size_t )length );
382360 if (n < 0 ) return 1 ;
383361 * p += n ;
@@ -391,7 +369,6 @@ lws_add_http3_header_by_token(struct lws *wsi, enum lws_token_indexes token,
391369 unsigned char * * p , unsigned char * end )
392370{
393371 int static_idx = lws_qpack_find_static_index ((int )token , (const char * )value , length );
394- struct lws_qpack_tx_encoder * enc = wsi ? wsi -> h3 .qpack_tx_encoder : NULL ;
395372 int n ;
396373
397374 if (static_idx != -1 ) {
@@ -400,25 +377,6 @@ lws_add_http3_header_by_token(struct lws *wsi, enum lws_token_indexes token,
400377 if (static_val && length == (int )strlen (static_val ) && !strncmp (static_val , (const char * )value , (size_t )length )) {
401378 n = lws_qpack_encode_static (* p , lws_ptr_diff_size_t (end , * p ), static_idx );
402379 } else {
403- if (enc ) {
404- const unsigned char * name = lws_token_to_string (token );
405- if (name ) {
406- int name_len = (int )strlen ((const char * )name );
407- if (name_len && name [name_len - 1 ] == ':' ) name_len -- ;
408- struct lws_qpack_tx_table_entry * dte = lws_qpack_tx_find (enc , (const char * )name , (size_t )name_len , (const char * )value , (size_t )length );
409- if (dte ) {
410- if (dte -> insert_index + 1 > wsi -> http .h3_req_ric ) wsi -> http .h3_req_ric = dte -> insert_index + 1 ;
411- n = lws_qpack_tx_encode_dynamic_index (* p , lws_ptr_diff_size_t (end , * p ), dte -> insert_index , wsi -> http .h3_base );
412- if (n >= 0 ) { * p += n ; return 0 ; }
413- }
414- int new_idx = lws_qpack_tx_insert (enc , (const char * )name , (size_t )name_len , (const char * )value , (size_t )length , static_idx );
415- if (new_idx >= 0 ) {
416- if ((uint32_t )new_idx + 1 > wsi -> http .h3_req_ric ) wsi -> http .h3_req_ric = (uint32_t )new_idx + 1 ;
417- n = lws_qpack_tx_encode_dynamic_name_ref (* p , lws_ptr_diff_size_t (end , * p ), (uint32_t )new_idx , wsi -> http .h3_base , (const char * )value , (size_t )length );
418- if (n >= 0 ) { * p += n ; return 0 ; }
419- }
420- }
421- }
422380 n = lws_qpack_encode_literal_with_name_ref (* p , lws_ptr_diff_size_t (end , * p ), static_idx , (const char * )value , (size_t )length );
423381 }
424382 } else {
@@ -1273,6 +1231,7 @@ lws_qpack_tx_encode_dynamic_name_ref(unsigned char *buf, size_t buf_len, uint32_
12731231 return ret + n ;
12741232}
12751233
1234+ #if 0
12761235static struct lws_qpack_tx_table_entry *
12771236lws_qpack_tx_find (struct lws_qpack_tx_encoder * enc , const char * name , size_t name_len , const char * val , size_t val_len )
12781237{
@@ -1383,6 +1342,7 @@ lws_qpack_tx_insert(struct lws_qpack_tx_encoder *enc, const char *name, size_t n
13831342
13841343 return (int )dte -> insert_index ;
13851344}
1345+ #endif
13861346
13871347LWS_VISIBLE void
13881348lws_qpack_tx_encoder_destroy (struct lws_qpack_tx_encoder * enc )
0 commit comments