http: reset state on error