swap \n for \000, update len check, when reading receive-pack input