Fix the excessive spinning problem when the package read is too large for the buffer.