mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
iClose socket if we end loading with an I/O operation in progress
This commit is contained in:
parent
e3b7fa5720
commit
c6df659d35
2 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2023-06-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSHTTPURLHandle.m: close socket if we end loading with an
|
||||
I/O operation in progress.
|
||||
|
||||
2023-06-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSFileHandle.m: Fix to reliably remove handle from run loop
|
||||
|
|
|
@ -1075,14 +1075,19 @@ debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
NSResetMapTable(wProperties);
|
||||
|
||||
/* 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.
|
||||
* marked idle, but the socket is already idle it may be re-used for
|
||||
* another request.
|
||||
*/
|
||||
if (sock)
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
[nc removeObserver: self name: nil object: sock];
|
||||
if (connectionState != idle)
|
||||
{
|
||||
[sock closeFile]; // Close to cancel any I/O in progress
|
||||
DESTROY(sock);
|
||||
}
|
||||
}
|
||||
connectionState = idle;
|
||||
[super endLoadInBackground];
|
||||
|
|
Loading…
Reference in a new issue