read_size_helper can return zero if the buffer reaches its maximum size, causing infinite loops in HTTP. The function maybe_read_size_helper is provided to throw an exception instead of returning a value for this case.