Don't send WINDOW_UPDATE automatically if SPDYLAY_OPT_NO_AUTO_WINDOW_UPDATE

is set.
This commit is contained in:
Tatsuhiro Tsujikawa 2012-05-08 23:29:24 +09:00
parent d6a03f74b7
commit fa04757ff4
1 changed files with 20 additions and 13 deletions

View File

@ -2255,7 +2255,8 @@ static int spdylay_session_process_data_frame(spdylay_session *session)
/* /*
* Accumulates received bytes |delta_size| and decides whether to send * Accumulates received bytes |delta_size| and decides whether to send
* WINDOW_UPDATE. * WINDOW_UPDATE. If SPDYLAY_OPT_NO_AUTO_WINDOW_UPDATE is set,
* WINDOW_UPDATE will not be sent.
* *
* This function returns 0 if it succeeds, or one of the following * This function returns 0 if it succeeds, or one of the following
* negative error codes: * negative error codes:
@ -2270,7 +2271,12 @@ static int spdylay_session_update_recv_window_size(spdylay_session *session,
spdylay_stream *stream; spdylay_stream *stream;
stream = spdylay_session_get_stream(session, stream_id); stream = spdylay_session_get_stream(session, stream_id);
if(stream) { if(stream) {
/* TODO If SPDYLAY_OPT_NO_AUTO_WINDOW_UPDATE is set and the
application does not send WINDOW_UPDATE and the remote endpoint
keeps sending data, stream->recv_window_size will eventually
overflow. */
stream->recv_window_size += delta_size; stream->recv_window_size += delta_size;
if(!(session->opt_flags & SPDYLAY_OPTMASK_NO_AUTO_WINDOW_UPDATE)) {
/* This is just a heuristics. */ /* This is just a heuristics. */
/* We have to use local_settings here because it is the constraint /* We have to use local_settings here because it is the constraint
the remote endpoint should honor. */ the remote endpoint should honor. */
@ -2286,6 +2292,7 @@ static int spdylay_session_update_recv_window_size(spdylay_session *session,
} }
} }
} }
}
return 0; return 0;
} }