From 4d738eb43c8b40401a762a234c9036d55708d08a Mon Sep 17 00:00:00 2001 From: captchanjack Date: Sun, 30 Jan 2022 03:31:19 +1100 Subject: [PATCH] [FIX] Fix bulk string handler so any \r\n present in the string is also returned --- Project.toml | 2 +- src/protocol.jl | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 9dd25ca..0ddd9c7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Jedis" uuid = "b89ccfe0-2c5f-46f6-b89b-da3e1c2e286f" authors = ["Jack Chan "] -version = "0.2.7" +version = "0.2.8" [deps] MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d" diff --git a/src/protocol.jl b/src/protocol.jl index 9f4299f..623c06b 100644 --- a/src/protocol.jl +++ b/src/protocol.jl @@ -56,7 +56,15 @@ function handle_bulk_string(io, x) if x == "-1" return nothing end - return readline(io) + + x = parse(Int, x) + r = "" + + while length(r) < x + 2 + r *= readline(io; keep=true) + end + + return r[1:end-2] end function handle_array(io, x)