Differences From Artifact [9340f7479b]:
- File
src/OFLHAArchive.m
— part of check-in
[d1d36ae522]
at
2021-11-06 15:57:29
on branch trunk
— OFStream: New write API
The old write API made it too easy to lose bytes when a stream is set to
non-blocking mode. The new API always throws when not all bytes were
written, which forces handling the number of bytes being written being
smaller than the number of bytes requested to be written. (user: js, size: 12007) [annotate] [blame] [check-ins using]
To Artifact [6f31d26ec9]:
- File src/OFLHAArchive.m — part of check-in [0eb7274946] at 2021-11-06 17:00:13 on branch trunk — Fix too strict OFEnsure introduced in last checkin (user: js, size: 12008) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
480 481 482 483 484 485 486 | if (UINT32_MAX - _bytesWritten < length) @throw [OFOutOfRangeException exception]; @try { [_stream writeBuffer: buffer length: length]; } @catch (OFWriteFailedException *e) { | | | 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 | if (UINT32_MAX - _bytesWritten < length) @throw [OFOutOfRangeException exception]; @try { [_stream writeBuffer: buffer length: length]; } @catch (OFWriteFailedException *e) { OFEnsure(e.bytesWritten <= length); _bytesWritten += (uint32_t)e.bytesWritten; _CRC16 = OFCRC16(_CRC16, buffer, e.bytesWritten); if (e.errNo == EWOULDBLOCK) return e.bytesWritten; |
︙ | ︙ |