Don't class-swizzle to call close on super.

This commit is contained in:
Jonathan Schleifer 2013-02-14 00:27:13 +01:00
parent eff94d1c96
commit 80b2cd676d
2 changed files with 9 additions and 12 deletions

View file

@ -43,8 +43,8 @@
- initWithSocket: (OFTCPSocket*)socket
privateKeyFile: (OFString*)privateKeyFile
certificateFile: (OFString*)certificateFile;
/* Change the return type */
- (SSLSocket*)accept;
- (void)SSL_super_close;
- (SSLSocket*)accept; /* Changes the return type */
- (void)setPrivateKeyFile: (OFString*)file;
- (OFString*)privateKeyFile;
- (void)setCertificateFile: (OFString*)file;

View file

@ -215,11 +215,7 @@ locking_callback(int mode, int n, const char *file, int line)
if ((client->_SSL = SSL_new(ctx)) == NULL ||
!SSL_set_fd(client->_SSL, client->_socket)) {
/* We only want to close the OFTCPSocket */
object_setClass(client, [OFTCPSocket class]);
[client close];
object_setClass(client, object_getClass(self));
[client SSL_super_close];
@throw [OFAcceptFailedException exceptionWithClass: [self class]
socket: self];
}
@ -234,11 +230,7 @@ locking_callback(int mode, int n, const char *file, int line)
SSL_FILETYPE_PEM) || !SSL_use_certificate_file(client->_SSL,
[_certificateFile cStringWithEncoding: OF_STRING_ENCODING_NATIVE],
SSL_FILETYPE_PEM) || SSL_accept(client->_SSL) != 1) {
/* We only want to close the OFTCPSocket */
object_setClass(client, [OFTCPSocket class]);
[client close];
object_setClass(client, object_getClass(self));
[client SSL_super_close];
@throw [OFAcceptFailedException exceptionWithClass: [self class]
socket: self];
}
@ -254,6 +246,11 @@ locking_callback(int mode, int n, const char *file, int line)
[super close];
}
- (void)SSL_super_close
{
[super close];
}
- (size_t)lowlevelReadIntoBuffer: (void*)buffer
length: (size_t)length
{