Reorganise a bit to ensure that TLS is properly shut down before the network

connection it relies on is closed.  Needed in case information is buffered
in the TLS layer and needs flushing to the remote end before shutdown.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37390 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-11-21 15:13:14 +00:00
parent b1ee5bf8a6
commit 12f935a8e4
4 changed files with 38 additions and 18 deletions

View file

@ -214,8 +214,7 @@ static NSString* NotificationKey = @"NSFileHandleNotificationKey";
[self ignoreWriteDescriptor];
#if USE_ZLIB
/*
* The gzDescriptor should always be closed when we have done with it.
/* The gzDescriptor should always be closed when we have done with it.
*/
if (gzDescriptor != 0)
{
@ -223,6 +222,14 @@ static NSString* NotificationKey = @"NSFileHandleNotificationKey";
gzDescriptor = 0;
}
#endif
/* Ensure any SSL/TLS connection has been properly shut down.
*/
[self sslDisconnect];
/* Close file descriptor if necessary (setting correct non-blocking
* characteristics since we may have changed them).
*/
if (descriptor != -1)
{
[self setNonBlocking: wasNonBlocking];
@ -232,6 +239,7 @@ static NSString* NotificationKey = @"NSFileHandleNotificationKey";
descriptor = -1;
}
}
[super finalize];
}
// Initializing a GSFileHandle Object