Changeset 6514:0aa07850922f in nginx


Ignore:
Timestamp:
04/14/16 12:14:15 (4 years ago)
Author:
Valentin Bartenev <vbart@…>
Branch:
default
Phase:
public
Message:

HTTP/2: refuse streams with data until SETTINGS is acknowledged.

A client is allowed to send requests before receiving and acknowledging
the SETTINGS frame. Such a client having a wrong idea about the stream's
could send the request body that nginx isn't ready to process.

The previous behavior was to send RST_STREAM with FLOW_CONTROL_ERROR in
such case, but it didn't allow retrying requests that have been rejected.

Location:
src/http/v2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/http/v2/ngx_http_v2.c

    r6513 r6514  
    10591059    }
    10601060
     1061    if (!h2c->settings_ack && !(h2c->state.flags & NGX_HTTP_V2_END_STREAM_FLAG))
     1062    {
     1063        status = NGX_HTTP_V2_REFUSED_STREAM;
     1064        goto rst_stream;
     1065    }
     1066
    10611067    node = ngx_http_v2_get_node_by_id(h2c, h2c->state.sid, 1);
    10621068
     
    18791885        }
    18801886
    1881         /* TODO settings acknowledged */
     1887        h2c->settings_ack = 1;
    18821888
    18831889        return ngx_http_v2_state_complete(h2c, pos, end);
  • src/http/v2/ngx_http_v2.h

    r6497 r6514  
    142142
    143143    unsigned                         closed_nodes:8;
     144    unsigned                         settings_ack:1;
    144145    unsigned                         blocked:1;
    145146};
Note: See TracChangeset for help on using the changeset viewer.