Skip to content

Commit

Permalink
[FIX] Fix bulk string handler so any \r\n present in the string is al…
Browse files Browse the repository at this point in the history
…so returned
  • Loading branch information
captchanjack committed Jan 29, 2022
1 parent da584bd commit 4d738eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Jedis"
uuid = "b89ccfe0-2c5f-46f6-b89b-da3e1c2e286f"
authors = ["Jack Chan <[email protected]>"]
version = "0.2.7"
version = "0.2.8"

[deps]
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
Expand Down
10 changes: 9 additions & 1 deletion src/protocol.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

2 comments on commit 4d738eb

@captchanjack
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/53435

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.8 -m "<description of version>" 4d738eb43c8b40401a762a234c9036d55708d08a
git push origin v0.2.8

Please sign in to comment.