Commit ba95cd93 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Fix flow control error because padding is excluded

parent 72e2e145
...@@ -1600,17 +1600,15 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session) ...@@ -1600,17 +1600,15 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
nghttp2_private_data *data_frame; nghttp2_private_data *data_frame;
nghttp2_outbound_item* next_item; nghttp2_outbound_item* next_item;
nghttp2_stream *stream; nghttp2_stream *stream;
size_t effective_payloadlen;
data_frame = nghttp2_outbound_item_get_data_frame(session->aob.item); data_frame = nghttp2_outbound_item_get_data_frame(session->aob.item);
stream = nghttp2_session_get_stream(session, data_frame->hd.stream_id); stream = nghttp2_session_get_stream(session, data_frame->hd.stream_id);
/* We update flow control window after a frame was completely /* We update flow control window after a frame was completely
sent. This is possible because we choose payload length not to sent. This is possible because we choose payload length not to
exceed the window */ exceed the window */
effective_payloadlen = data_frame->hd.length - data_frame->padlen; session->remote_window_size -= data_frame->hd.length;
session->remote_window_size -= effective_payloadlen;
if(stream) { if(stream) {
stream->remote_window_size -= effective_payloadlen; stream->remote_window_size -= data_frame->hd.length;
} }
if(session->callbacks.on_frame_send_callback) { if(session->callbacks.on_frame_send_callback) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment