move the response checking up into the retry clause (bug 838885)
Merge pull request #286 from andymckay/838885

move the response checking up into the retry clause (bug 838885)