Fix bug of keep alive logic while transfering file.