snehac-miner / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

binary value (\r\n) #73

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you serialise an object and store it as key, there is a rare but 
possible chance the value with have a \r\n somewhere in the middle. 
Everything after the \r\n will be ignored. Is there a way to buffer this 
(on Redis side) perhaps prepending with the value length?

What steps will reproduce the problem?
1. serialise an object with \r\n in the middle of the stream
2. set serialised object with simple key
3. get serialised object with same key

What is the expected output? What do you see instead?
- Expect the same output as input serialised object.

What version of the product are you using? On what operating system?
- redis-1.01

Original issue reported on code.google.com by alexgen...@gmail.com on 21 Oct 2009 at 1:20

GoogleCodeExporter commented 8 years ago
I was mistaken. The client was reading results by line rather than counting 
bytes. It 
seems values can be any byte stream at all (at least byte values 0-127, as I'm 
limited 
to ASCII). Keys can also be any byte except 0 (null), 10 (\n), and 32 (space), 
which 
are all command delimiters.

Original comment by alexgen...@gmail.com on 21 Oct 2009 at 5:12

GoogleCodeExporter commented 8 years ago
indeed, keys are not binary safe, but values are. You can even put a JPEG file 
or any
kind of data as value. But not as key (for now).

Original comment by anti...@gmail.com on 23 Oct 2009 at 12:40