You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately the snappy decompression will not work as currently implemented. The reason is that snappy_uncompress is being called directly on data returned from a socket read regardless of the whether that read results in a complete snappy block or not. Sockets are streams; you may get back 1 byte, everything the peer wrote, or any number in between depending on prevailing network conditions.
The snappy framing format was invented to solve this problem. Basically you need to read frame headers from the stream to inform you of the size of the incoming compressed data which needs to be buffered up using as many reads as it takes to get it all in before the complete buffer can be passed to the decompressor.
This is exactly the same problem that the LZ4 decompressor suffered from.
The text was updated successfully, but these errors were encountered:
Unfortunately the snappy decompression will not work as currently implemented. The reason is that
snappy_uncompress
is being called directly on data returned from a socket read regardless of the whether that read results in a complete snappy block or not. Sockets are streams; you may get back 1 byte, everything the peer wrote, or any number in between depending on prevailing network conditions.The snappy framing format was invented to solve this problem. Basically you need to read frame headers from the stream to inform you of the size of the incoming compressed data which needs to be buffered up using as many reads as it takes to get it all in before the complete buffer can be passed to the decompressor.
This is exactly the same problem that the LZ4 decompressor suffered from.
The text was updated successfully, but these errors were encountered: