ObjFW  Diff

Differences From Artifact [a76eca16d0]:

To Artifact [eb397d13f9]:


73
74
75
76
77
78
79
80

81
82
83
84
85
86
87
73
74
75
76
77
78
79

80
81
82
83
84
85
86
87







-
+







{
	void *pool = objc_autoreleasePoolPush();
	OFStream **objects;
	fd_set readFDs_;
	fd_set writeFDs_;
	fd_set exceptFDs_;
	struct timeval time;
	size_t i, count;
	size_t i, count, realEvents = 0;

	[self _processQueue];

	if ([self _processCache]) {
		objc_autoreleasePoolPop(pool);
		return YES;
	}
118
119
120
121
122
123
124
125


126
127


128

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149


150
151
152




153

154
155
156



157
158
159
160
118
119
120
121
122
123
124

125
126
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151

152
153
154


155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170







-
+
+

-
+
+

+




















-
+
+

-
-
+
+
+
+

+



+
+
+




	count = [readStreams count];

	for (i = 0; i < count; i++) {
		int fileDescriptor = [objects[i] fileDescriptor];

		pool = objc_autoreleasePoolPush();

		if (FD_ISSET(fileDescriptor, &readFDs_))
		if (FD_ISSET(fileDescriptor, &readFDs_)) {
			realEvents++;
			[delegate streamIsReadyForReading: objects[i]];

		}

		if (FD_ISSET(fileDescriptor, &exceptFDs_)) {
			realEvents++;
			[delegate streamDidReceiveException: objects[i]];

			/*
			 * Prevent calling it twice in case the FD is in both
			 * sets.
			 */
			FD_CLR(fileDescriptor, &exceptFDs_);
		}

		objc_autoreleasePoolPop(pool);
	}

	objects = [writeStreams objects];
	count = [writeStreams count];

	for (i = 0; i < count; i++) {
		int fileDescriptor = [objects[i] fileDescriptor];

		pool = objc_autoreleasePoolPush();

		if (FD_ISSET(fileDescriptor, &writeFDs_))
		if (FD_ISSET(fileDescriptor, &writeFDs_)) {
			realEvents++;
			[delegate streamIsReadyForWriting: objects[i]];

		if (FD_ISSET(fileDescriptor, &exceptFDs_))
		}

		if (FD_ISSET(fileDescriptor, &exceptFDs_)) {
			realEvents++;
			[delegate streamDidReceiveException: objects[i]];
		}

		objc_autoreleasePoolPop(pool);
	}

	if (realEvents == 0)
		return NO;

	return YES;
}
@end