From 057db65657e331cfa0d61b0719ffd67a93893abc Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 21 Jun 2016 22:30:21 +0900 Subject: [PATCH] Rewrite session_append_inflight_settings --- lib/nghttp2_session.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index da105819..341d7fa4 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -6682,17 +6682,12 @@ int nghttp2_session_add_window_update(nghttp2_session *session, uint8_t flags, static void session_append_inflight_settings(nghttp2_session *session, nghttp2_inflight_settings *settings) { - nghttp2_inflight_settings *i; + nghttp2_inflight_settings **i; - if (!session->inflight_settings_head) { - session->inflight_settings_head = settings; - return; - } - - for (i = session->inflight_settings_head; i->next; i = i->next) + for (i = &session->inflight_settings_head; *i; i = &(*i)->next) ; - i->next = settings; + *i = settings; } int nghttp2_session_add_settings(nghttp2_session *session, uint8_t flags,