]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
doh2: ensure memory from unsent streams is freed
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 18 Aug 2021 13:18:27 +0000 (15:18 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Wed, 18 Aug 2021 15:25:04 +0000 (17:25 +0200)
commitda6bbccb04619fa2f711e329110edc5446e265ce
treed970a895e10675cebe9591953a59eb4475e80c95
parentcb2e1af9d38f77779fcfd9e51faf8e148eb4fabf
doh2: ensure memory from unsent streams is freed

The nghttp2 on_stream_close callback is only called for streams that are
properly closed. If we need to tear down the HTTP connection due to any
reason (e.g. IO error in underlying layer), some streams may not be
propely closed.

Due to HTTP/2 flow control, we may also wait indefinitely for the data
to be written. This can also cause the stream to never be properly
closed.

To handle these cases, a reference of allocated data is kept and we
ensure everything is freed once we're closing the http session.
NEWS
daemon/http.c
daemon/http.h
daemon/session.c