Fix recently introduced bug with premature connection close

This commit is contained in:
Richard Frith-Macdonald 2023-02-01 19:17:12 +00:00
parent b549e72432
commit b8aedfc53e
2 changed files with 19 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2022-01-01 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPURLHandle.m: fix incorrect close of socket at the end
of a successful request.
2022-01-08 Richard Frith-Macdonald <rfm@gnu.org>
* ChangeLog: Update for new release
@ -29,7 +34,7 @@
* Source/GSHTTPURLHandle.m: Use the https_proxy and http_proxy
environment variables if no proxying is specified. Also support
those keys as properties in the request (overriding the environment
variables) and support the URL protection spece if set.
variables) and support the URL protection space if set.
2022-11-26 Fred Kiefer <fredkiefer@gmx.de>
@ -87,7 +92,7 @@
2022-10-21 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPURLHandle.m: Refactor a litle to avoid code duplication
and try to ensure that the connection is mared 'idle' as soon as we
and try to ensure that the connection is marked 'idle' as soon as we
have finished I/O (so its URL can be changed).
2022-10-20 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -1073,7 +1073,18 @@ debugWrite(GSHTTPURLHandle *handle, NSData *data)
{
DESTROY(wData);
NSResetMapTable(wProperties);
[self _disconnect];
/* Socket must be removed from I/O notifications and connection state
* marked idle, but the socket is left open to be re-used for another
* request.
*/
if (sock)
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc removeObserver: self name: nil object: sock];
}
connectionState = idle;
[super endLoadInBackground];
}