Skip to content

Commit

Permalink
fix leakage of connections
Browse files Browse the repository at this point in the history
- connection should be closed IFF HTTPClient is owned by download
- introduced in 90b2fbc
  • Loading branch information
MartinNowak committed Jan 26, 2018
1 parent 5a32f49 commit ab5ebe9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inet/vibe/inet/urltransfer.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void download(HTTPClient_ = void*)(URL url, scope void delegate(scope InputStrea
static if (is(HTTPClient_ == HTTPClient)) client = client_;
if (!client) client = new HTTPClient();
scope (exit) {
if (client_ !is null)
if (client_ is null) // disconnect default client
client.disconnect();
}

Expand Down

0 comments on commit ab5ebe9

Please sign in to comment.