Overview
Comment: | OFKernelEventObserver: Allow mutation in observe |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
0b478d8138010ff25222067f02481944 |
User & Date: | js on 2020-10-31 18:27:34 |
Other Links: | manifest | tags |
Context
2020-10-31
| ||
19:16 | OFHTTPClient: Remove didFailWithException check-in: 7f102e8c95 user: js tags: trunk | |
18:27 | OFKernelEventObserver: Allow mutation in observe check-in: 0b478d8138 user: js tags: trunk | |
2020-10-26
| ||
00:04 | pbkdf2.h: Add missing __unsafe_unretained check-in: 84dbf46bda user: js tags: trunk | |
Changes
Modified src/OFKernelEventObserver.m from [58babda954] to [0cbb2bba17].
︙ | ︙ | |||
210 211 212 213 214 215 216 217 218 | - (void)removeObjectForWriting: (id <OFReadyForWritingObserving>)object { [_writeObjects removeObjectIdenticalTo: object]; } - (bool)of_processReadBuffers { bool foundInReadBuffer = false; | > | | | > > | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | - (void)removeObjectForWriting: (id <OFReadyForWritingObserving>)object { [_writeObjects removeObjectIdenticalTo: object]; } - (bool)of_processReadBuffers { void *pool = objc_autoreleasePoolPush(); bool foundInReadBuffer = false; for (id object in [[_readObjects copy] autorelease]) { void *pool2 = objc_autoreleasePoolPush(); if ([object isKindOfClass: [OFStream class]] && [object hasDataInReadBuffer] && ![(OFStream *)object of_isWaitingForDelimiter]) { if ([_delegate respondsToSelector: @selector(objectIsReadyForReading:)]) [_delegate objectIsReadyForReading: object]; foundInReadBuffer = true; } objc_autoreleasePoolPop(pool2); } objc_autoreleasePoolPop(pool); /* * As long as we have data in the read buffer for any stream, we don't * want to block. */ return foundInReadBuffer; } |
︙ | ︙ |
Modified src/OFSelectKernelEventObserver.m from [f86117a30a] to [22b01117bc].
︙ | ︙ | |||
163 164 165 166 167 168 169 | FD_CLR((of_socket_t)fd, &_writeFDs); [super removeObjectForWriting: object]; } - (void)observeForTimeInterval: (of_time_interval_t)timeInterval { | < | | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | FD_CLR((of_socket_t)fd, &_writeFDs); [super removeObjectForWriting: object]; } - (void)observeForTimeInterval: (of_time_interval_t)timeInterval { fd_set readFDs; fd_set writeFDs; struct timeval timeout; int events; #ifdef OF_AMIGAOS ULONG execSignalMask, cancelSignal; #endif void *pool; if ([self of_processReadBuffers]) return; #ifdef FD_COPY FD_COPY(&_readFDs, &readFDs); FD_COPY(&_writeFDs, &writeFDs); |
︙ | ︙ | |||
245 246 247 248 249 250 251 | # else OF_ENSURE(recvfrom(_cancelFD[0], (void *)&buffer, 1, 0, NULL, NULL) == 1); # endif } #endif | < | | > | | | | | | < < | | | | | > > | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | # else OF_ENSURE(recvfrom(_cancelFD[0], (void *)&buffer, 1, 0, NULL, NULL) == 1); # endif } #endif pool = objc_autoreleasePoolPush(); for (id <OFReadyForReadingObserving> object in [[_readObjects copy] autorelease]) { void *pool2 = objc_autoreleasePoolPush(); int fd = object.fileDescriptorForReading; if (FD_ISSET((of_socket_t)fd, &readFDs) && [_delegate respondsToSelector: @selector(objectIsReadyForReading:)]) [_delegate objectIsReadyForReading: object]; objc_autoreleasePoolPop(pool2); } for (id <OFReadyForWritingObserving> object in [[_writeObjects copy] autorelease]) { void *pool2 = objc_autoreleasePoolPush(); int fd = object.fileDescriptorForWriting; if (FD_ISSET((of_socket_t)fd, &writeFDs) && [_delegate respondsToSelector: @selector(objectIsReadyForWriting:)]) [_delegate objectIsReadyForWriting: object]; objc_autoreleasePoolPop(pool2); } objc_autoreleasePoolPop(pool); } @end |