ObjFW  Check-in [79ac3fe177]

Overview
Comment:OFTLSSocket: Reduce methods to override
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 79ac3fe177eb057e1f6f1ff2e84ea862acc852a2bb1b3e295a55d04c8a6631b0
User & Date: js on 2021-11-07 19:39:32
Other Links: manifest | tags
Context
2021-11-07
19:44
Let -[OFStream flushWriteBuffer] return a bool check-in: 7faf776e26 user: js tags: trunk
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
Changes

Modified src/OFTLSSocket.h from [163daa0bfa] to [5dd4f959ef].

30
31
32
33
34
35
36
37



38
39
40
41
42
43
44
45
46
47
48
49
 *
 * @brief A class that provides Transport Layer Security on top of a TCP socket.
 *
 * This class is a class cluster and returns a suitable OFTLSSocket subclass,
 * if available.
 *
 * Subclasses need to override @ref accept, @ref lowlevelReadIntoBuffer:length:,
 * @ref lowlevelWriteBuffer:length:, @ref lowlevelIsAtEndOfStream and



 * @ref startTLSForHost:port:. In order to get access to the lowlevel TCP
 * methods (you cannot call `super`, as the class is abstract), the private
 * methods @ref TCPAccept, @ref lowlevelTCPReadIntoBuffer:length:,
 * @ref lowlevelTCPWriteBuffer:length: and @ref lowlevelTCPIsAtEndOfStream are
 * provided.
 */
@interface OFTLSSocket: OFTCPSocket
{
	bool _verifiesCertificates;
	OF_RESERVE_IVARS(OFTLSSocket, 4)
}








|
>
>
>
|
|
|
|
<







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
 *
 * @brief A class that provides Transport Layer Security on top of a TCP socket.
 *
 * This class is a class cluster and returns a suitable OFTLSSocket subclass,
 * if available.
 *
 * Subclasses need to override @ref accept, @ref lowlevelReadIntoBuffer:length:,
 * @ref lowlevelWriteBuffer:length: and @ref startTLSForHost:port:. The method
 * @ref hasDataInReadBuffer should be overridden to return `true` if the TLS
 * socket has cached unprocessed data internally, while returning
 * `[super hasDataInReadBuffer]` if it does not have any unprocessed data. In
 * order to get access to the lowlevel TCP methods (you cannot call `super`, as
 * the class is abstract), the private methods @ref TCPAccept,
 * @ref lowlevelTCPReadIntoBuffer:length: and
 * @ref lowlevelTCPWriteBuffer:length: are provided.

 */
@interface OFTLSSocket: OFTCPSocket
{
	bool _verifiesCertificates;
	OF_RESERVE_IVARS(OFTLSSocket, 4)
}

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
- (size_t)lowlevelTCPReadIntoBuffer: (void *)buffer length: (size_t)length;

/**
 * @brief This method should never be called directly. Only subclasses of
 *	  @ref OFTLSSocket are allowed to call it.
 */
- (size_t)lowlevelTCPWriteBuffer: (const void *)buffer length: (size_t)length;

/**
 * @brief This method should never be called directly. Only subclasses of
 *	  @ref OFTLSSocket are allowed to call it.
 */
- (bool)lowlevelTCPIsAtEndOfStream;
@end

#ifdef __cplusplus
extern "C" {
#endif
/**
 * @brief The concrete subclass of OFTLSSocket that should be used.







<
<
<
<
<
<







99
100
101
102
103
104
105






106
107
108
109
110
111
112
- (size_t)lowlevelTCPReadIntoBuffer: (void *)buffer length: (size_t)length;

/**
 * @brief This method should never be called directly. Only subclasses of
 *	  @ref OFTLSSocket are allowed to call it.
 */
- (size_t)lowlevelTCPWriteBuffer: (const void *)buffer length: (size_t)length;






@end

#ifdef __cplusplus
extern "C" {
#endif
/**
 * @brief The concrete subclass of OFTLSSocket that should be used.

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

196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length
{
	OF_UNRECOGNIZED_SELECTOR
}

- (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length
{
	OF_UNRECOGNIZED_SELECTOR
}

- (bool)lowlevelIsAtEndOfStream
{
	OF_UNRECOGNIZED_SELECTOR
}

- (instancetype)TCPAccept
{
	return [super accept];
}







<
<
<
<
<







196
197
198
199
200
201
202





203
204
205
206
207
208
209
- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length
{
	OF_UNRECOGNIZED_SELECTOR
}

- (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length
{





	OF_UNRECOGNIZED_SELECTOR
}

- (instancetype)TCPAccept
{
	return [super accept];
}