From 817e1ce2a7edb995957ef1a39cd8d4673ed6eb07 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 18 Jun 2014 10:56:32 +0900 Subject: [PATCH] Rename last_stream_id in nghttp2_session to remote_last_stream_id This commits also fixes last stream ID in GOAWAY uses wrong stream ID. --- lib/nghttp2_session.c | 4 ++-- lib/nghttp2_session.h | 2 +- lib/nghttp2_submit.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 90d6ac62..9c7c1c40 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -322,7 +322,7 @@ static int session_new(nghttp2_session **session_ptr, (*session_ptr)->local_window_size = NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE; (*session_ptr)->goaway_flags = NGHTTP2_GOAWAY_NONE; - (*session_ptr)->last_stream_id = 0; + (*session_ptr)->remote_last_stream_id = 0; (*session_ptr)->inflight_niv = -1; @@ -3650,7 +3650,7 @@ int nghttp2_session_on_goaway_received(nghttp2_session *session, return session_handle_invalid_connection(session, frame, NGHTTP2_PROTOCOL_ERROR); } - session->last_stream_id = frame->goaway.last_stream_id; + session->remote_last_stream_id = frame->goaway.last_stream_id; session->goaway_flags |= NGHTTP2_GOAWAY_RECV; return session_call_on_frame_received(session, frame); } diff --git a/lib/nghttp2_session.h b/lib/nghttp2_session.h index 3ae11ad1..1e7691a3 100644 --- a/lib/nghttp2_session.h +++ b/lib/nghttp2_session.h @@ -190,7 +190,7 @@ struct nghttp2_session { NGHTTP2_MAX_UNIQUE_ID */ uint32_t next_unique_id; /* This is the value in GOAWAY frame received from remote endpoint. */ - int32_t last_stream_id; + int32_t remote_last_stream_id; /* Current sender window size. This value is computed against the current initial window size of remote endpoint. */ int32_t remote_window_size; diff --git a/lib/nghttp2_submit.c b/lib/nghttp2_submit.c index bc43b5b9..56faec4d 100644 --- a/lib/nghttp2_submit.c +++ b/lib/nghttp2_submit.c @@ -249,7 +249,7 @@ int nghttp2_submit_goaway(nghttp2_session *session, uint8_t flags, nghttp2_error_code error_code, const uint8_t *opaque_data, size_t opaque_data_len) { - return nghttp2_session_add_goaway(session, session->last_stream_id, + return nghttp2_session_add_goaway(session, session->last_proc_stream_id, error_code, opaque_data, opaque_data_len); }