mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-04 10:30:47 +00:00
revert
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37391 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
971a8374a8
commit
0e8eff792c
4 changed files with 18 additions and 38 deletions
|
@ -953,22 +953,29 @@ GSTLSHandlePush(gnutls_transport_ptr_t handle, const void *buffer, size_t len)
|
|||
|
||||
- (void) closeFile
|
||||
{
|
||||
[self sslDisconnect]; // Shut down TLS before closing socket
|
||||
[self sslDisconnect];
|
||||
[super closeFile];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
/* Any TLS connection needs to be shut down before the network connection
|
||||
* is closed, which means that the concrete subclass must do that.
|
||||
* Therefore, the session should be inactive by the time we get here.
|
||||
*/
|
||||
NSAssert(NO == [session active], NSInternalInconsistencyException);
|
||||
DESTROY(session);
|
||||
DESTROY(opts);
|
||||
// TLS may need to read data during teardown, and we need to wait for it.
|
||||
[self setNonBlocking: NO];
|
||||
// Don't DESTROY ivars below. First release them, then set nil, because
|
||||
// `session' may need this back-reference during TLS teardown.
|
||||
TEST_RELEASE(opts);
|
||||
TEST_RELEASE(session);
|
||||
opts = nil;
|
||||
session = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) finalize
|
||||
{
|
||||
[self sslDisconnect];
|
||||
[super finalize];
|
||||
}
|
||||
|
||||
- (NSInteger) read: (void*)buf length: (NSUInteger)len
|
||||
{
|
||||
if (YES == [session active])
|
||||
|
@ -980,14 +987,7 @@ GSTLSHandlePush(gnutls_transport_ptr_t handle, const void *buffer, size_t len)
|
|||
|
||||
- (void) sslDisconnect
|
||||
{
|
||||
if (nil != session)
|
||||
{
|
||||
// TLS may need to read data during teardown, and we need to wait for it.
|
||||
[self setNonBlocking: NO];
|
||||
[session disconnect];
|
||||
DESTROY(session);
|
||||
}
|
||||
DESTROY(opts);
|
||||
[session disconnect];
|
||||
}
|
||||
|
||||
- (BOOL) sslHandshakeEstablished: (BOOL*)result outgoing: (BOOL)isOutgoing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue