Skip to content

Commit cb81be4

Browse files
committed
http/Client: OnDechunkEnd() returns CLOSE, not DESTROYED
Using CLOSED is easier and allows the caller to decide when to destroy the DechunkIstream object. Additionally, DESTROYED is illegal when called from DechunkIstream::_ConsumeBucketList() because that method must not destroy the DechunkIstream.
1 parent 00645a2 commit cb81be4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

debian/changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cm4all-beng-proxy (21.18) unstable; urgency=low
22

33
* bp: discard MOUNT_LISTEN_STREAM processes under memory pressure
44
* bp: reduce MOUNT_LISTEN_STREAM idle timeout to 2 minutes
5+
* http_client: fix use-after-free bug
56
* istream/dechunk: fix integer overflow
67

78
--

src/http/Client.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ class HttpClient final : BufferedSocketHandler, IstreamSink, Cancellable, Destru
192192
DechunkInputAction OnDechunkEnd() noexcept final {
193193
GetClient().SocketDone();
194194
GetClient().stopwatch.RecordEvent("end");
195-
GetClient().Destroy();
196-
return DechunkInputAction::DESTROYED;
195+
return DechunkInputAction::CLOSE;
197196
}
198197
};
199198

0 commit comments

Comments
 (0)