]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: got rid of HTTP/2 module dependency.
authorVladimir Homutov <vl@nginx.com>
Thu, 5 Aug 2021 08:09:13 +0000 (11:09 +0300)
committerVladimir Homutov <vl@nginx.com>
Thu, 5 Aug 2021 08:09:13 +0000 (11:09 +0300)
The Huffman encoder/decoder now can be built separately from HTTP/2 module.

auto/modules
src/http/ngx_http.h
src/http/v2/ngx_http_v2.h

index d454466af4be44782864ad899145ac1193d477e6..7430bfe6b0a1c8e8e9951a435da11472b2254d78 100644 (file)
@@ -421,9 +421,6 @@ if [ $HTTP = YES ]; then
         have=NGX_HTTP_HEADERS . auto/have
         HTTP_QUIC=YES
 
-        # XXX for Huffman
-        HTTP_V2=YES
-
         ngx_module_name=ngx_http_v3_module
         ngx_module_incs=src/http/v3
         ngx_module_deps="src/http/v3/ngx_http_v3.h \
@@ -441,6 +438,12 @@ if [ $HTTP = YES ]; then
         ngx_module_libs=
         ngx_module_link=$HTTP_V3
 
+        if [ $HTTP_V2 = NO ]; then
+            ngx_module_srcs="$ngx_module_srcs \
+                             src/http/v2/ngx_http_v2_huff_decode.c \
+                             src/http/v2/ngx_http_v2_huff_encode.c"
+        fi
+
         . auto/module
     fi
 
index 70109adc27af0618a1d3d2daa5a54413186c7554..fb4157715dfa482f80fb963310de0e0b1f9babba 100644 (file)
@@ -180,6 +180,12 @@ ngx_int_t ngx_http_set_default_types(ngx_conf_t *cf, ngx_array_t **types,
 ngx_uint_t  ngx_http_degraded(ngx_http_request_t *);
 #endif
 
+#if (NGX_HTTP_V2 || NGX_HTTP_V3)
+ngx_int_t ngx_http_v2_huff_decode(u_char *state, u_char *src, size_t len,
+    u_char **dst, ngx_uint_t last, ngx_log_t *log);
+size_t ngx_http_v2_huff_encode(u_char *src, size_t len, u_char *dst,
+    ngx_uint_t lower);
+#endif
 
 extern ngx_module_t  ngx_http_module;
 
index 349229711926390ac9f3805c2abf938e207b45e1..65fc6581231d8bb49886fb65bc51fcc405aec7f8 100644 (file)
@@ -312,12 +312,6 @@ ngx_int_t ngx_http_v2_add_header(ngx_http_v2_connection_t *h2c,
 ngx_int_t ngx_http_v2_table_size(ngx_http_v2_connection_t *h2c, size_t size);
 
 
-ngx_int_t ngx_http_v2_huff_decode(u_char *state, u_char *src, size_t len,
-    u_char **dst, ngx_uint_t last, ngx_log_t *log);
-size_t ngx_http_v2_huff_encode(u_char *src, size_t len, u_char *dst,
-    ngx_uint_t lower);
-
-
 #define ngx_http_v2_prefix(bits)  ((1 << (bits)) - 1)