ObjFW  Check-in [b7b67d7119]

Overview
Comment:Improve OFTLSSocket protocol.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b7b67d7119028feda785c8e2fa77b0d0c4e4c741e767abf74657f15ad6c25c64
User & Date: js on 2013-03-31 10:04:17
Other Links: manifest | tags
Context
2013-03-31
14:20
OFTLSSocket: Add support for SNI. check-in: 2c65fa15ef user: js tags: trunk
10:04
Improve OFTLSSocket protocol. check-in: b7b67d7119 user: js tags: trunk
2013-03-30
20:07
Improve code readability. check-in: 57a6e8ef79 user: js tags: trunk
Changes

Modified src/OFTCPSocket.h from [efe8886d8a] to [63a39507d8].

207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
- (void)listen;

/*!
 * @brief Accept an incoming connection.
 *
 * @return An autoreleased OFTCPSocket for the accepted connection.
 */
- (OFTCPSocket*)accept;

/*!
 * @brief Asyncronously accept an incoming connection.
 *
 * @param target The target on which to execute the selector when a new
 *		 connection has been accepted. The method returns whether the
 *		 next incoming connection should be accepted by the specified







|







207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
- (void)listen;

/*!
 * @brief Accept an incoming connection.
 *
 * @return An autoreleased OFTCPSocket for the accepted connection.
 */
- (instancetype)accept;

/*!
 * @brief Asyncronously accept an incoming connection.
 *
 * @param target The target on which to execute the selector when a new
 *		 connection has been accepted. The method returns whether the
 *		 next incoming connection should be accepted by the specified

Modified src/OFTCPSocket.m from [5920a82404] to [131468c3e0].

639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
}

- (void)listen
{
	[self listenWithBackLog: SOMAXCONN];
}

- (OFTCPSocket*)accept
{
	OFTCPSocket *client;
	struct sockaddr_storage *addr;
	socklen_t addrLen;
	int socket;

	client = [[[[self class] alloc] init] autorelease];







|







639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
}

- (void)listen
{
	[self listenWithBackLog: SOMAXCONN];
}

- (instancetype)accept
{
	OFTCPSocket *client;
	struct sockaddr_storage *addr;
	socklen_t addrLen;
	int socket;

	client = [[[[self class] alloc] init] autorelease];

Modified src/OFTLSSocket.h from [dde8b87a0d] to [ba8f726fac].

45
46
47
48
49
50
51
















52
53
54
55
56
57
58
@protocol OFTLSSocket
#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFTLSSocketDelegate> delegate;
@property (copy) OFString *certificateFile, *privateKeyFile;
@property const char *privateKeyPassphrase;
#endif

















/*!
 * @brief Sets a delegate for the TLS socket.
 *
 * @param delegate The delegate to use
 */
- (void)setDelegate: (id <OFTLSSocketDelegate>)delegate;








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@protocol OFTLSSocket
#ifdef OF_HAVE_PROPERTIES
@property (assign) id <OFTLSSocketDelegate> delegate;
@property (copy) OFString *certificateFile, *privateKeyFile;
@property const char *privateKeyPassphrase;
#endif

/*!
 * @brief Initializes the TLS socket with the specified TCP socket as its
 *	  underlying socket.
 *
 * @param socket The TCP socket to use as underlying socket
 */
- initWithSocket: (OFTCPSocket*)socket;

/*!
 * @brief Initiates the TLS handshake.
 *
 * @note This is only useful if you used @ref initWithSocket: to start TLS on
 *	 a TCP socket which is already connected!
 */
- (void)startTLS;

/*!
 * @brief Sets a delegate for the TLS socket.
 *
 * @param delegate The delegate to use
 */
- (void)setDelegate: (id <OFTLSSocketDelegate>)delegate;