Re: http2 broken

2018-07-11 Thread 洪志道
Get it, I'll try it, thank you again.

On Thu, Jul 12, 2018 at 1:02 AM Maxim Dounin  wrote:

> Hello!
>
> On Wed, Jul 11, 2018 at 08:56:56PM +0800, 洪志道 wrote:
>
> > But there are still some clients use the old version.
> > Is it a way to be compatible with it?
> > Or other suggestions?
> > @Maxim Dounin 
>
> As I already wrote in ticket #1397, we can try introducing a
> workaround in nginx, but I'm not convinced it worth the effort and,
> more importantly, associated downsides for non-broken clients.
>
> # HG changeset patch
> # User Maxim Dounin 
> # Date 1531328359 -10800
> #  Wed Jul 11 19:59:19 2018 +0300
> # Node ID f44e74d331885dce8682d2a9802eb707be7ae86f
> # Parent  54683f650cbdcd73f7f8d845c843295978da5a85
> HTTP/2: workaround for clients which fail on table size updates.
>
> There are clients which cannot handle HPACK's dynamic table size updates
> as added in 12cadc4669a7 (1.13.6).  Notably, old versions of OkHttp library
> are known to fail on it (ticket #1397).
>
> This change makes it possible to work with such clients by only sending
> dynamic table size updates in response to SETTINGS_HEADER_TABLE_SIZE.  As
> a downside, clients which do not use SETTINGS_HEADER_TABLE_SIZE will
> continue to maintain default 4k table.
>
> diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
> --- a/src/http/v2/ngx_http_v2.c
> +++ b/src/http/v2/ngx_http_v2.c
> @@ -270,8 +270,6 @@ ngx_http_v2_init(ngx_event_t *rev)
>
>  h2c->frame_size = NGX_HTTP_V2_DEFAULT_FRAME_SIZE;
>
> -h2c->table_update = 1;
> -
>  h2scf = ngx_http_get_module_srv_conf(hc->conf_ctx,
> ngx_http_v2_module);
>
>  h2c->concurrent_pushes = h2scf->concurrent_pushes;
> @@ -2075,6 +2073,11 @@ ngx_http_v2_state_settings_params(ngx_ht
>  h2c->concurrent_pushes = ngx_min(value,
> h2scf->concurrent_pushes);
>  break;
>
> +case NGX_HTTP_V2_HEADER_TABLE_SIZE_SETTING:
> +
> +h2c->table_update = 1;
> +break;
> +
>  default:
>  break;
>  }
>
> --
> Maxim Dounin
> http://mdounin.ru/
> ___
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: http2 broken

2018-07-11 Thread Maxim Dounin
Hello!

On Wed, Jul 11, 2018 at 08:56:56PM +0800, 洪志道 wrote:

> But there are still some clients use the old version.
> Is it a way to be compatible with it?
> Or other suggestions?
> @Maxim Dounin 

As I already wrote in ticket #1397, we can try introducing a 
workaround in nginx, but I'm not convinced it worth the effort and, 
more importantly, associated downsides for non-broken clients.

# HG changeset patch
# User Maxim Dounin 
# Date 1531328359 -10800
#  Wed Jul 11 19:59:19 2018 +0300
# Node ID f44e74d331885dce8682d2a9802eb707be7ae86f
# Parent  54683f650cbdcd73f7f8d845c843295978da5a85
HTTP/2: workaround for clients which fail on table size updates.

There are clients which cannot handle HPACK's dynamic table size updates
as added in 12cadc4669a7 (1.13.6).  Notably, old versions of OkHttp library
are known to fail on it (ticket #1397).

This change makes it possible to work with such clients by only sending
dynamic table size updates in response to SETTINGS_HEADER_TABLE_SIZE.  As
a downside, clients which do not use SETTINGS_HEADER_TABLE_SIZE will
continue to maintain default 4k table.

diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -270,8 +270,6 @@ ngx_http_v2_init(ngx_event_t *rev)
 
 h2c->frame_size = NGX_HTTP_V2_DEFAULT_FRAME_SIZE;
 
-h2c->table_update = 1;
-
 h2scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v2_module);
 
 h2c->concurrent_pushes = h2scf->concurrent_pushes;
@@ -2075,6 +2073,11 @@ ngx_http_v2_state_settings_params(ngx_ht
 h2c->concurrent_pushes = ngx_min(value, h2scf->concurrent_pushes);
 break;
 
+case NGX_HTTP_V2_HEADER_TABLE_SIZE_SETTING:
+
+h2c->table_update = 1;
+break;
+
 default:
 break;
 }

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: http2 broken

2018-07-11 Thread 洪志道
Thank you.

But there are still some clients use the old version.
Is it a way to be compatible with it?
Or other suggestions?
@Maxim Dounin 


On Wed, Jul 11, 2018 at 5:43 PM tokers  wrote:

> Hello!
>
> There is a known issue caused by some obsolete client like old version
> okhttp (incomplete protocol implements).
> Here is the ticket: https://trac.nginx.org/nginx/ticket/1397.
> ___
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: http2 broken

2018-07-11 Thread tokers
Hello!

There is a known issue caused by some obsolete client like old version
okhttp (incomplete protocol implements).
Here is the ticket: https://trac.nginx.org/nginx/ticket/1397.
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: http2 broken

2018-07-11 Thread 洪志道
BTW. It works well by the temporary fix.

--- a/src/http/v2/ngx_http_v2_filter_module.c
+++ b/src/http/v2/ngx_http_v2_filter_module.c
@@ -446,7 +446,6 @@ ngx_http_v2_header_filter(ngx_http_request_t *r)
 if (h2c->table_update) {
 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, fc->log, 0,
"http2 table size update: 0");
-*pos++ = (1 << 5) | 0;
 h2c->table_update = 0;
 }

@@ -1010,7 +1009,6 @@ ngx_http_v2_push_resource(ngx_http_request_t *r,
ngx_str_t *pat
 if (h2c->table_update) {
 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, fc->log, 0,
"http2 table size update: 0");
-*pos++ = (1 << 5) | 0;
 h2c->table_update = 0;
 }



On Wed, Jul 11, 2018 at 5:28 PM 洪志道  wrote:

> Hi.
>
> The client can't load the image served by nginx-1.13.6+.
> [App with Android 7.1.2  4.4.4  4.12 series]
>
> It works well in nginx-1.13.5, but go wrong in ngnx-1.13.6+.
> The change is http://hg.nginx.org/nginx/rev/12cadc4669a7.
>
> I found the similar problem.
> https://github.com/cloudflare/sslconfig/issues/83
>
> Now I don't know where the problem is. NGINX or Client?
>
> Does anyone know?
> Thanks.
>
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel