<div dir="ltr">hi,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 26, 2014 at 3:02 PM, Valentin V. Bartenev <span dir="ltr"><<a href="mailto:vbart@nginx.com" target="_blank">vbart@nginx.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wednesday 26 March 2014 12:30:11 Xiaochen Wang wrote:<br>
> In our production, sometimes, the disk was full. In which case, the requests<br>
> after the POST request were handled wrongly in one spdy connection.<br>
><br>
> Because the input body (DATA frame) of POST request could not be written to disk,<br>
> then ngx_http_spdy_state_read_data() tried to skip this DATA frame with wrong<br>
> sc->length, which broke spdy stream.<br>
><br>
><br>
> # HG changeset patch<br>
> # User Xiaochen Wang <<a href="mailto:wangxiaochen0@gmail.com">wangxiaochen0@gmail.com</a>><br>
> # Date 1395807655 -28800<br>
> # Node ID c18a0115c6027ad0ad475061d2984d90544d8449<br>
> # Parent bd91f286ee0ade98e9c0f8f55bfef54a122adaf2<br>
> SPDY: fixed handling of sc->length in ngx_http_spdy_state_read_data()<br>
><br>
> diff -r bd91f286ee0a -r c18a0115c602 src/http/ngx_http_spdy.c<br>
> --- a/src/http/ngx_http_spdy.c Mon Mar 24 16:35:44 2014 -0700<br>
> +++ b/src/http/ngx_http_spdy.c Wed Mar 26 12:20:55 2014 +0800<br>
> @@ -1519,7 +1519,6 @@<br>
> complete = 1;<br>
><br>
> } else {<br>
> - sc->length -= size;<br>
> complete = 0;<br>
> }<br>
><br>
> @@ -1567,6 +1566,7 @@<br>
> buf->pos = pos;<br>
><br>
> pos += size;<br>
> + sc->length -= size;<br>
><br>
> buf->end = pos;<br>
> buf->last = pos;<br>
> @@ -1585,6 +1585,7 @@<br>
> } else {<br>
> buf->last = ngx_cpymem(buf->last, pos, size);<br>
> pos += size;<br>
> + sc->length -= size;<br>
> }<br>
><br>
> r->request_length += size;<br>
><br>
<br>
</div></div>Thank you for the report. I'd prefer a slightly smaller patch:<br></blockquote><div>Agree.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r e45fa57ef725 src/http/ngx_http_spdy.c<br>
--- a/src/http/ngx_http_spdy.c Thu Mar 06 23:15:10 2014 +0400<br>
+++ b/src/http/ngx_http_spdy.c Wed Mar 26 10:55:33 2014 +0400<br>
@@ -1496,7 +1496,6 @@ ngx_http_spdy_state_read_data(ngx_http_s<br>
<div class=""> complete = 1;<br>
<br>
} else {<br>
- sc->length -= size;<br>
complete = 0;<br>
}<br>
<br>
</div>@@ -1539,6 +1538,8 @@ ngx_http_spdy_state_read_data(ngx_http_s<br>
<div class=""> }<br>
}<br>
<br>
+ sc->length -= size;<br>
</div>+</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
if (tf) {<br>
buf->start = pos;<br>
buf->pos = pos;<br>
<br>
--<br>
<br>
wbr, Valentin V. Bartenev<br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</blockquote></div><br></div><div class="gmail_extra">Thanks,</div><div class="gmail_extra">Xiaochen</div></div>