]> git.kaiwu.me - nginx.git/commitdiff
SPDY: avoid sending RST_STREAM on WINDOW_UPDATE with unknown SID.
authorValentin Bartenev <vbart@nginx.com>
Mon, 21 Apr 2014 15:21:17 +0000 (19:21 +0400)
committerValentin Bartenev <vbart@nginx.com>
Mon, 21 Apr 2014 15:21:17 +0000 (19:21 +0400)
There's a race condition between closing a stream by one endpoint
and sending a WINDOW_UPDATE frame by another.  So it would be better
to just skip such frames for unknown streams, like is already done
for the DATA frames.

src/http/ngx_http_spdy.c

index 9d6b67f807b80ed0256bae047a7393018fcbe8ec..a09e4ac0bdf9aee2fbb22a317fd76c1c809893ef 100644 (file)
@@ -1341,16 +1341,8 @@ ngx_http_spdy_state_window_update(ngx_http_spdy_connection_t *sc, u_char *pos,
         stream = ngx_http_spdy_get_stream_by_id(sc, sid);
 
         if (stream == NULL) {
-            ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
-                          "client sent WINDOW_UPDATE frame "
-                          "for unknown stream %ui", sid);
-
-            if (ngx_http_spdy_send_rst_stream(sc, sid, NGX_SPDY_INVALID_STREAM,
-                                              NGX_SPDY_LOWEST_PRIORITY)
-                == NGX_ERROR)
-            {
-                return ngx_http_spdy_state_internal_error(sc);
-            }
+            ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
+                           "unknown spdy stream");
 
             return ngx_http_spdy_state_complete(sc, pos, end);
         }