file - Binary Safety redis -


in redis protocol specification, mentions that:

"status replies not binary safe , can't include newlines." mean string/file binary safe? , why can't status replies in redis binary safe?

a binary safe string parser accounts possible values 0 - 255 in single character within string, string not null terminated (it's length known otherwise). if string parser isn't binary safe, it's expecting null terminated string (a binary 0 @ of string).

usually, string parser not binary safe. many parses expect normal printable characters , 0 @ end of string. if there not 0 @ end of kind of string, there segmentation fault.

binary safe parsers parsing arbitrary data (may text or else).

edit:

"what mean string/file binary safe?"

  • it's text parser binary safe, not string/file itself. however, if string called binary safe, suspect means null-terminated string standard ascii characters.

"and why can't status replies in redis binary safe?"

  • because parser implementation checks replies ends @ first instance of \r\n. how parser figures out length of string. if it's finds \r\n before end of reply, stops parsing , disregards afterwards.

unless status replies need send binary data, there no need them binary safe.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -