{"push_id":1069012863,"size":2,"distinct_size":1,"ref":"refs/heads/master","head":"b6d808b5b1d7c72c1dba1f8dd29c1e534ebb94db","before":"f237098b2e94d447030de96c76e7effe6628d660","commits":[{"sha":"241680a479da497890f5dcc24221b17ec2f65356","author":{"email":"8493db2a4f45d66df375afe12f7eba59fe1c8d78@gmail.com","name":"Juan Cruz Viotti"},"message":"Fix \"Error: stream.push() after EOF\"\n\nConsider some data, for example, the Ubuntu 15.10 Desktop AMD64 image\nfrom http://releases.ubuntu.com/15.10/ubuntu-15.10-desktop-amd64.iso\n\nThe size of this file is `1178386432` bytes. If we create a readable\nstream out of this file, my system (rMBP running OS X) will read in\nblocks of `65536`.\n\nNow let's try dividing the Ubuntu image size by our hypothetical buffer\nlength:\n\n    1178386432 / 65536 = 17980.75\n\nNotice the result is a float number, and thus the image file can't be\nread in an integral amount of blocks.\n\nThis causes `slice-stream` to receive one more buffer in\n`._transform()`. Even if you signaled the end of the stream (EOF) by\npushing `null`, `slice-stream` will send this last buffer to the slice\nfunction, so the user will try to push it, and therefore get:\n\n  Error: stream.push() after EOF\n\nAs a workaround, I can set the readable stream's high water mark to a\nnumber that cleanly divides the image size, like `1024`, and everything\nwill work fine, however to have more protection from this module, its a\ngood idea to check if the stream is `readable` (e.g: EOF has not been\nsignaled yet), before attempting to process a new buffer.\n\nI managed to create a test case with a small image (2MB) and setting a\nhigh water mark of `10` (since 2048 is not cleanly divisible by `10`).\n\nThis issue as originally reported at https://github.com/resin-io/etcher/issues/307\nSigned-off-by: Juan Cruz Viotti <jviottidc@gmail.com>","distinct":false,"url":"https://api.github.com/repos/jviotti/slice-stream2/commits/241680a479da497890f5dcc24221b17ec2f65356"},{"sha":"b6d808b5b1d7c72c1dba1f8dd29c1e534ebb94db","author":{"email":"8493db2a4f45d66df375afe12f7eba59fe1c8d78@gmail.com","name":"Juan Cruz Viotti"},"message":"Merge pull request #1 from jviotti/fix/stream-push-after-eof\n\nFix \"Error: stream.push() after EOF\"","distinct":true,"url":"https://api.github.com/repos/jviotti/slice-stream2/commits/b6d808b5b1d7c72c1dba1f8dd29c1e534ebb94db"}]}