Backport an upstream fix for a nil header

353d5951da
7c984ea66e
bug/bundler_fix
William Vu 2015-06-05 11:45:53 -05:00
parent e151e38181
commit 15916f0ab0
1 changed files with 1 additions and 0 deletions

View File

@ -234,6 +234,7 @@ class RbMysql
begin
Timeout.timeout @read_timeout do
header = @sock.read(4)
raise EOFError unless header && header.length == 4
len1, len2, seq = header.unpack("CvC")
len = (len2 << 8) + len1
# Ignore the sequence number -- protocol differences between 4.x and 5.x