Differences From Artifact [74500121cd]:
- File
src/OFKernelEventObserver.m
— part of check-in
[cec0f072f8]
at
2016-01-03 00:43:58
on branch 0.8
— Update copyright
While at it, also update the mail address. (user: js, size: 5514) [annotate] [blame] [check-ins using]
To Artifact [b44fb07041]:
- File
src/OFKernelEventObserver.m
— part of check-in
[b84490ab4f]
at
2016-03-20 12:05:46
on branch 0.8
— Never block when the read buffer is non-empty
This was broken by 88f2f03. The problem only existed when something was
in the read buffer, but not processed completely, as after processing
the read buffer, it would go on to wait for data - but since not the
entire read buffer had been processed, it meant there was still data
left there that needed to be handled first. (user: js, size: 5712) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
220 221 222 223 224 225 226 | # else OF_ENSURE(sendto(_cancelFD[1], "", 1, 0, (struct sockaddr*)&_cancelAddr, 8) > 0); # endif #endif } | | > | | | | > > > | > > > > > > | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | # else OF_ENSURE(sendto(_cancelFD[1], "", 1, 0, (struct sockaddr*)&_cancelAddr, 8) > 0); # endif #endif } - (bool)OF_processReadBuffers { id const *objects = [_readObjects objects]; size_t i, count = [_readObjects count]; bool foundInReadBuffer = false; for (i = 0; i < count; i++) { void *pool = objc_autoreleasePoolPush(); if ([objects[i] isKindOfClass: [OFStream class]] && [objects[i] hasDataInReadBuffer] && ![objects[i] OF_isWaitingForDelimiter]) { if ([_delegate respondsToSelector: @selector(objectIsReadyForReading:)]) [_delegate objectIsReadyForReading: objects[i]]; foundInReadBuffer = true; } objc_autoreleasePoolPop(pool); } /* * As long as we have data in the read buffer for any stream, we don't * want to block. */ return foundInReadBuffer; } @end |