Isn't buffer_size being passed into as the max message size here? Shouldn't buffer_size be used for min_bytes below (line 374), and this should be a max message size parameter that doesn't grow on error?