Patch to add a timeout option.