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

@ -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];
}