Skip to content

Commit

Permalink
fixed #44: use read_fully to avoid incomplete read (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacuum authored and bcardiff committed Nov 6, 2018
1 parent 32f1246 commit 9cd8e08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mysql/read_packet.cr
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MySql::ReadPacket < IO

def read(slice : Bytes)
return 0 unless @remaining > 0
read_bytes = @io.read(slice)
read_bytes = @io.read_fully(slice)
@remaining -= read_bytes
read_bytes
rescue IO::EOFError
Expand Down

0 comments on commit 9cd8e08

Please sign in to comment.