Loop until we get an acceptable response.