From bcde1fc58845120b88b7236e5d5dda070543350d Mon Sep 17 00:00:00 2001 From: Phil Sorber Date: Mon, 22 Aug 2016 10:47:03 -0600 Subject: [PATCH] TS-3929: TSRemapNewInstance and TSRemapDeleteInstance should be mutually inclusive. --- proxy/http/remap/RemapConfig.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc index 91e3ca70619..8d7ed87d5c5 100644 --- a/proxy/http/remap/RemapConfig.cc +++ b/proxy/http/remap/RemapConfig.cc @@ -817,9 +817,19 @@ remap_load_plugin(const char **argv, int argc, url_mapping *mp, char *errbuf, in if (!pi->fp_tsremap_init) { snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin \"%s\"", TSREMAP_FUNCNAME_INIT, c); retcode = -10; + } else if (!pi->fp_tsremap_new_instance && pi->fp_tsremap_delete_instance) { + snprintf(errbuf, errbufsize, + "Can't find \"%s\" function in remap plugin \"%s\" which is required if \"%s\" function exists", + TSREMAP_FUNCNAME_NEW_INSTANCE, c, TSREMAP_FUNCNAME_DELETE_INSTANCE); + retcode = -11; } else if (!pi->fp_tsremap_do_remap) { snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin \"%s\"", TSREMAP_FUNCNAME_DO_REMAP, c); retcode = -12; + } else if (pi->fp_tsremap_new_instance && !pi->fp_tsremap_delete_instance) { + snprintf(errbuf, errbufsize, + "Can't find \"%s\" function in remap plugin \"%s\" which is required if \"%s\" function exists", + TSREMAP_FUNCNAME_DELETE_INSTANCE, c, TSREMAP_FUNCNAME_NEW_INSTANCE); + retcode = -13; } if (retcode) { if (errbuf && errbufsize > 0)