fix broken pipe

need to read http response to sync connection state