ObjFW  Check-in [e7bb41764c]

Overview
Comment:OFStreamObserver: Don't ignore the timeout when using select().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 0.5
Files: files | file ages | folders
SHA3-256: e7bb41764ce40f8cf7875d2f6442cd4a1370d712fba3e2dc78163f9763e79c10
User & Date: js on 2011-04-22 20:43:20
Other Links: branch diff | manifest | tags
Context
2011-04-22
21:59
OFURL: Do -[copy] in a try block to prevent leaks. check-in: 43f9221508 user: js tags: 0.5
20:43
OFStreamObserver: Don't ignore the timeout when using select(). check-in: e7bb41764c user: js tags: 0.5
18:22
Fix double-retain in OFList. check-in: 66302f7848 user: js tags: 0.5
Changes

Modified src/OFStreamObserver.m from [90468a0a65] to [4bdac00ac8].

485
486
487
488
489
490
491



492
493
494
495
496
497
498
	FD_COPY(&exceptfds, &exceptfds_);
# else
	readfds_ = readfds;
	writefds_ = writefds;
	exceptfds_ = exceptfds;
# endif




	if (select(nfds, &readfds_, &writefds_, &exceptfds_,
	    (timeout != -1 ? &tv : NULL)) < 1)
		return NO;

	if (FD_ISSET(cancelFd[0], &readfds_)) {
		char buf;
#ifndef _WIN32







>
>
>







485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
	FD_COPY(&exceptfds, &exceptfds_);
# else
	readfds_ = readfds;
	writefds_ = writefds;
	exceptfds_ = exceptfds;
# endif

	tv.tv_sec = timeout / 1000;
	tv.tv_usec = (timeout % 1000) * 1000;

	if (select(nfds, &readfds_, &writefds_, &exceptfds_,
	    (timeout != -1 ? &tv : NULL)) < 1)
		return NO;

	if (FD_ISSET(cancelFd[0], &readfds_)) {
		char buf;
#ifndef _WIN32