ObjFW  Check-in [746ddd7d7f]

Overview
Comment:Fix OFTLSSocket for the case sockets are not FDs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 746ddd7d7f3ec570f82e64eac54f071fc6055e45297417732ed63f3a4dc1005f
User & Date: js on 2021-11-06 17:36:29
Other Links: manifest | tags
Context
2021-11-07
19:39
OFTLSSocket: Reduce methods to override check-in: 79ac3fe177 user: js tags: trunk
2021-11-06
17:36
Fix OFTLSSocket for the case sockets are not FDs check-in: 746ddd7d7f user: js tags: trunk
17:00
Fix too strict OFEnsure introduced in last checkin check-in: 0eb7274946 user: js tags: trunk
Changes

Modified src/OFTLSSocket.h from [38e4f875d1] to [163daa0bfa].

62
63
64
65
66
67
68



69
70
71
72
73
74
75
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78







+
+
+







 * The default is enabled.
 */
@property (nonatomic) bool verifiesCertificates;

/**
 * @brief Initializes the TLS socket with the specified TCP socket as its
 *	  underlying socket.
 *
 * The passed socket will become invalid, as the internal socket handle gets
 * moved from the specified socket to the OFTLSSocket.
 *
 * @param socket The TCP socket to use as underlying socket
 */
- (instancetype)initWithSocket: (OFTCPSocket *)socket;

/**
 * @brief Start TLS on the underlying socket with the assumption that it is

Modified src/OFTLSSocket.m from [d6f41e909e] to [d04b51f1a5].

127
128
129
130
131
132
133

134

135
136
137
138
139
140
141
142
127
128
129
130
131
132
133
134

135

136
137
138
139
140
141
142







+
-
+
-







{
	self = [super init];

	@try {
		if ([socket isKindOfClass: [OFTLSSocket class]])
			@throw [OFInvalidArgumentException exception];

		_socket = socket->_socket;
		if ((_socket = dup(socket->_socket)) == OFInvalidSocketHandle)
		socket->_socket = OFInvalidSocketHandle;
			@throw [OFInitializationFailedException exception];

		_verifiesCertificates = true;
	} @catch (id e) {
		[self release];
		@throw e;
	}