Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-07 Thread Haitao Lv
available = h2mcf->recv_buffer_size - 2 * NGX_HTTP_V2_STATE_BUFFER_SIZE; +available = h2mcf->recv_buffer_size - h2c->state.buffer_used - 2 * NGX_HTTP_V2_STATE_BUFFER_SIZE; do { p = h2mcf->recv_buffer; -ngx_memcpy(p, h2c->state.buffer, NGX_HTTP_V2_STATE_BUFFER_SI

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-07 Thread Haitao Lv
c->state.buffer, NGX_HTTP_V2_STATE_BUFFER_SIZE); end = p + h2c->state.buffer_used; +if (h2c->state.buffer_used == 0) { +ngx_memcpy(p, h2c->state.buffer, NGX_HTTP_V2_STATE_BUFFER_SIZE); +} n = c->recv(c, end, available); > On Ma

Re: [PATCH] HTTP/2: make http2 server support http1

2018-04-01 Thread Haitao Lv
Any body is here? > On Mar 21, 2018, at 11:36, Haitao Lv <i...@lvht.net> wrote: > > Thank you for reviewing. > > And here is the patch that fix the breaking PROXY protocol functionality. > > Sorry for disturbing. > > diff --git a/src/http/ngx_http_reques

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-18 Thread Haitao Lv
uesday 13 March 2018 00:44:28 吕海涛 wrote: >> Is there any one who would like to review this patch? >> >> 发自我的 iPhone >> >>> 在 2018年3月8日,08:42,Haitao Lv <i...@lvht.net> 写道: >>> >>> Sorry for disturbing. But I have to fix a buffer over

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-20 Thread Haitao Lv
recv_buffer_size - 2 * NGX_HTTP_V2_STATE_BUFFER_SIZE; +available = h2mcf->recv_buffer_size - h2c->state.buffer_used - 2 * NGX_HTTP_V2_STATE_BUFFER_SIZE; do { p = h2mcf->recv_buffer; -ngx_memcpy(p, h2c->state.buffer, NGX_HTTP_V2_STATE_BUFFER_SIZE); end =

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-03 Thread Haitao Lv
er_size. If we got a buffered data larger than the h2mcf->recv_buffer_size, we should send a bad request response. If this feature can be accepted, I will send a new patch. Thanks. > On Mar 2, 2018, at 15:53, Haitao Lv <i...@lvht.net> wrote: > > # HG changeset patch &

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-03 Thread Haitao Lv
ate_handler: + h2c->state.buffer_used = 0; h2c->state.incomplete = 0; diff --git a/src/http/v2/ngx_http_v2.h b/src/http/v2/ngx_http_v2.h index d89e8fef..cc9251f0 100644 --- a/src/http/v2/ngx_http_v2.h +++ b/src/http/v2/ngx_http_v2.h @@ -279,6 +279,7 @@ ngx_http_v2_queue_ord

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-04 Thread Haitao Lv
> On Mar 4, 2018, at 21:00, Valentin V. Bartenev <vb...@nginx.com> wrote: > > On Sunday, 4 March 2018 05:53:36 MSK Haitao Lv wrote: >> Hi, wbr, >> >> Thanks for your review. I don't know why I can't receive your email. >> Let me reply directly. >&g

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-04 Thread Haitao Lv
@wbr > On Mar 4, 2018, at 13:49, Haitao Lv <i...@lvht.net> wrote: > > Here is the new patch > > diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c > index 9d8b6d79..c06ef7c7 100644 > --- a/src/http/ngx_http.c > +++ b/src/http/ngx_http.c > @@ -1197,6

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-05 Thread Haitao Lv
> On Mar 5, 2018, at 17:02, Ruslan Ermilov <r...@nginx.com> wrote: > > On Mon, Mar 05, 2018 at 11:11:08AM +0800, Haitao Lv wrote: > [...] >>> @@ -145,10 +152,6 @@ ngx_http_parse_request_line(ngx_http_request_t *r, >>> ngx_buf_t *b) >>>case

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-05 Thread Haitao Lv
Hello wbr, Thank you for reviewing this patch. > On Mar 5, 2018, at 23:06, Valentin V. Bartenev <vb...@nginx.com> wrote: > > On Monday 05 March 2018 11:11:08 Haitao Lv wrote: > [..] >>> @@ -145,10 +152,6 @@ ngx_http_parse_request_line(ngx_http_request_t *r, >&g

[PATCH] HTTP/2: make http2 server support http1

2018-03-01 Thread Haitao Lv
# HG changeset patch # User 吕海涛 # Date 1519976498 -28800 # Fri Mar 02 15:41:38 2018 +0800 # Node ID 200955343460c4726015180f20c03e31c0b35ff6 # Parent 81fae70d6cb81c67607931ec3ecc585a609c97e0 make http2 server support http1 diff -r 81fae70d6cb8 -r 200955343460

Re: [PATCH] HTTP/2: make http2 server support http1

2018-03-05 Thread Haitao Lv
Hello, here is another patch(more sample) according Maxim Dounin advice. Please offer your comment. Thanks. diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 89cfe77a..71bc7b59 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -17,6 +17,10