Differences From Artifact [9b934c5330]:
- File src/OFRunLoop.m — part of check-in [481225349f] at 2017-09-24 12:24:23 on branch trunk — OFStream: Add support for async writes (user: js, size: 20669) [annotate] [blame] [check-ins using]
To Artifact [8ab72d20c1]:
- File
src/OFRunLoop.m
— part of check-in
[47db5636d7]
at
2017-09-24 13:15:54
on branch trunk
— Return a bool from async write handlers
This allows performing another write with the same buffer, length and
callback, which is useful for asynchronously writing in chunks. (user: js, size: 20777) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
282 283 284 285 286 287 288 | _writtenLength += length; if (_writtenLength != _length && exception == nil) return true; # ifdef OF_HAVE_BLOCKS | | | > > > > | | | | | > > > > < < | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | _writtenLength += length; if (_writtenLength != _length && exception == nil) return true; # ifdef OF_HAVE_BLOCKS if (_block != NULL) { if (!_block(object, _buffer, _writtenLength, exception)) return false; _writtenLength = 0; return true; } else { # endif bool (*func)(id, SEL, OFStream *, const void *, size_t, id, id) = (bool (*)(id, SEL, OFStream *, const void *, size_t, id, id))[_target methodForSelector: _selector]; if (!func(_target, _selector, object, _buffer, _writtenLength, _context, exception)) return false; _writtenLength = 0; return true; # ifdef OF_HAVE_BLOCKS } # endif } - (void)dealloc { [_block release]; [super dealloc]; |
︙ | ︙ |