comparison src/http/ngx_http_spdy.c @ 5665:46d0795a846c

SPDY: avoid sending RST_STREAM on WINDOW_UPDATE with unknown SID. 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.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 21 Apr 2014 19:21:17 +0400
parents de93bbe2d8cd
children 5cf537731218
comparison
equal deleted inserted replaced
5664:de93bbe2d8cd 5665:46d0795a846c
1339 1339
1340 if (sid) { 1340 if (sid) {
1341 stream = ngx_http_spdy_get_stream_by_id(sc, sid); 1341 stream = ngx_http_spdy_get_stream_by_id(sc, sid);
1342 1342
1343 if (stream == NULL) { 1343 if (stream == NULL) {
1344 ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0, 1344 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
1345 "client sent WINDOW_UPDATE frame " 1345 "unknown spdy stream");
1346 "for unknown stream %ui", sid);
1347
1348 if (ngx_http_spdy_send_rst_stream(sc, sid, NGX_SPDY_INVALID_STREAM,
1349 NGX_SPDY_LOWEST_PRIORITY)
1350 == NGX_ERROR)
1351 {
1352 return ngx_http_spdy_state_internal_error(sc);
1353 }
1354 1346
1355 return ngx_http_spdy_state_complete(sc, pos, end); 1347 return ngx_http_spdy_state_complete(sc, pos, end);
1356 } 1348 }
1357 1349
1358 if (stream->send_window > (ssize_t) (NGX_SPDY_MAX_WINDOW - delta)) { 1350 if (stream->send_window > (ssize_t) (NGX_SPDY_MAX_WINDOW - delta)) {