mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +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
|
@ -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…
Add table
Add a link
Reference in a new issue