# Error occurs when both padding and continuation are enabled

**URL:** <https://www.ruby-forum.com/t/error-occurs-when-both-padding-and-continuation-are-enabled/243925>\
**Category:** NGINX\
**Created:** [January 26, 2016, 9:01am UTC](https://www.ruby-forum.com/t/error-occurs-when-both-padding-and-continuation-are-enabled/243925 "2016-01-26T09:01:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [January 26, 2016, 9:01am UTC](https://www.ruby-forum.com/t/error-occurs-when-both-padding-and-continuation-are-enabled/243925/1 "2016-01-26T09:01:31Z")

</div>

Hi,

Another error I met recently. It occurred when both padding and  
continuation are enabled.

A normal HEADERS frame was divided as follows:  
HEADERS ===\> HEADERS(PADDED\_FLAG) + CONTINUATION + CONTINUATION

After sending these frames, I got an error. In the debug log file, I  
found  
“client sent inappropriate frame while CONTINUATION was expected while  
processing HTTP/2 connection”. Then I read the source code (v 1.9.9),  
and  
located the function “ngx\_http\_v2\_handle\_continuation” (ngx\_http\_v2.c,  
line  
1749). It seems NGINX does not skip the “padding part”, but tries to  
read  
“type” field in the next CONTINUATION frame directly.

However, when testing padding and continuation frame separately, NGINX  
can  
handle both cases well. I don’t know whether I did something wrong or  
this  
is a bug in NGINX. I also sent the same frames to other servers (nghttp,  
h2o, GWS), and got the responses successfully.

Thanks!

Shengtuo Hu

---

<div class="post-metadata">

**Author:** ![Shengtuo\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@Shengtuo\_Hu](https://www.ruby-forum.com/u/Shengtuo_Hu)\
**Post date:** [January 26, 2016, 12:55pm UTC](https://www.ruby-forum.com/t/error-occurs-when-both-padding-and-continuation-are-enabled/243925/2 "2016-01-26T12:55:12Z")

</div>

On Tuesday 26 January 2016 16:00:08 Shengtuo Hu wrote:

> processing HTTP/2 connection". Then I read the source code (v 1.9.9), and  
> located the function “ngx\_http\_v2\_handle\_continuation” (ngx\_http\_v2.c, line  
> 1749). It seems NGINX does not skip the “padding part”, but tries to read  
> “type” field in the next CONTINUATION frame directly.

[..]

Yes, you’re right. It isn’t able to skip padding between HEADERS and  
CONTINUATION frames.

wbr, Valentin V. Bartenev

---

<div class="post-metadata">

**Author:** ![Shengtuo\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@Shengtuo\_Hu](https://www.ruby-forum.com/u/Shengtuo_Hu)\
**Post date:** [February 2, 2016, 3:03pm UTC](https://www.ruby-forum.com/t/error-occurs-when-both-padding-and-continuation-are-enabled/243925/3 "2016-02-02T15:03:43Z")

</div>

On Tuesday 26 January 2016 14:54:56 Valentin V. Bartenev wrote:

> > “client sent inappropriate frame while CONTINUATION was expected while  
> > processing HTTP/2 connection”. Then I read the source code (v 1.9.9), and  
> > located the function “ngx\_http\_v2\_handle\_continuation” (ngx\_http\_v2.c, line  
> > 1749). It seems NGINX does not skip the “padding part”, but tries to read  
> > “type” field in the next CONTINUATION frame directly.
> 
> [..]
> 
> Yes, you’re right. It isn’t able to skip padding between HEADERS and  
> CONTINUATION frames.

That has been fixed: [hg.nginx.org is decommissioned](http://hg.nginx.org/nginx/rev/0e0e2e522fa2)

Thanks for the report.

wbr, Valentin V. Bartenev
