ObjFW  Check-in [c02886307e]

Overview
Comment:OFStreamSocket: Require open socket in -[accept]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c02886307e9d9c447f01149d29c28439ad17e18dab37b945fae5eadf8dabaf71
User & Date: js on 2023-02-11 23:49:34
Other Links: manifest | tags
Context
2023-02-12
22:20
Add OFMatrix4x4 and OFVector3D check-in: 44eb35b212 user: js tags: trunk
2023-02-11
23:49
OFStreamSocket: Require open socket in -[accept] check-in: c02886307e user: js tags: trunk
23:26
Doxyfile: Define OF_FILE_MANAGER_SUPPORTS_* check-in: bc4e978728 user: js tags: trunk
Changes

Modified src/OFStreamSocket.m from [5e77bcfd73] to [0cffca82b0].

238
239
240
241
242
243
244
245
246
247
248
249
250
251




252
253
254
255
256
257
258
				  errNo: OFSocketErrNo()];

	_listening = true;
}

- (instancetype)accept
{
	OFStreamSocket *client = [[[[self class] alloc] init] autorelease];
#if (!defined(HAVE_PACCEPT) && !defined(HAVE_ACCEPT4)) || !defined(SOCK_CLOEXEC)
# if defined(HAVE_FCNTL) && defined(FD_CLOEXEC)
	int flags;
# endif
#endif





	client->_remoteAddress.length =
	    (socklen_t)sizeof(client->_remoteAddress.sockaddr);

#if defined(HAVE_PACCEPT) && defined(SOCK_CLOEXEC)
	if ((client->_socket = paccept(_socket,
	    (struct sockaddr *)&client->_remoteAddress.sockaddr,
	    &client->_remoteAddress.length, NULL, SOCK_CLOEXEC)) ==







|






>
>
>
>







238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
				  errNo: OFSocketErrNo()];

	_listening = true;
}

- (instancetype)accept
{
	OFStreamSocket *client;
#if (!defined(HAVE_PACCEPT) && !defined(HAVE_ACCEPT4)) || !defined(SOCK_CLOEXEC)
# if defined(HAVE_FCNTL) && defined(FD_CLOEXEC)
	int flags;
# endif
#endif

	if (_socket == OFInvalidSocketHandle)
		@throw [OFNotOpenException exceptionWithObject: self];

	client = [[[[self class] alloc] init] autorelease];
	client->_remoteAddress.length =
	    (socklen_t)sizeof(client->_remoteAddress.sockaddr);

#if defined(HAVE_PACCEPT) && defined(SOCK_CLOEXEC)
	if ((client->_socket = paccept(_socket,
	    (struct sockaddr *)&client->_remoteAddress.sockaddr,
	    &client->_remoteAddress.length, NULL, SOCK_CLOEXEC)) ==