Adding a counter to the reading of the response so that a bad response cannot
cause a crash on the client.