Author: zwoop
Date: Thu Oct 13 18:16:59 2011
New Revision: 1183019

URL: http://svn.apache.org/viewvc?rev=1183019&view=rev
Log:
TS-948 Do not reload remap.config with broken plugins

Modified:
    trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc
    trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.h
    trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc

Modified: trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc
URL: 
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc?rev=1183019&r1=1183018&r2=1183019&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc Thu Oct 13 
18:16:59 2011
@@ -24,7 +24,7 @@
 #include "RemapPluginInfo.h"
 
 remap_plugin_info::remap_plugin_info(char *_path)
-  :  next(0), path(NULL), path_size(0), dlh(NULL), fp_tsremap_init(NULL), 
fp_tsremap_done(NULL), fptsremap_new_instance(NULL),
+  :  next(0), path(NULL), path_size(0), dlh(NULL), fp_tsremap_init(NULL), 
fp_tsremap_done(NULL), fp_tsremap_new_instance(NULL),
      fp_tsremap_delete_instance(NULL), fp_tsremap_do_remap(NULL), 
fp_tsremap_os_response(NULL) 
 {
   // coverity did not see ats_free

Modified: trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.h
URL: 
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.h?rev=1183019&r1=1183018&r2=1183019&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.h (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.h Thu Oct 13 
18:16:59 2011
@@ -66,7 +66,7 @@ public:
   void *dlh;                    /* "handle" for the dynamic library */
   _tsremap_init *fp_tsremap_init;
   _tsremap_done *fp_tsremap_done;
-  _tsremap_new_instance *fptsremap_new_instance;
+  _tsremap_new_instance *fp_tsremap_new_instance;
   _tsremap_delete_instance *fp_tsremap_delete_instance;
   _tsremap_do_remap *fp_tsremap_do_remap;
   _tsremap_os_response *fp_tsremap_os_response;

Modified: trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc
URL: 
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc?rev=1183019&r1=1183018&r2=1183019&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc Thu Oct 13 
18:16:59 2011
@@ -1667,7 +1667,7 @@ UrlRewrite::load_remap_plugin(char *argv
     }
     pi->fp_tsremap_init = (remap_plugin_info::_tsremap_init *) dlsym(pi->dlh, 
TSREMAP_FUNCNAME_INIT);
     pi->fp_tsremap_done = (remap_plugin_info::_tsremap_done *) dlsym(pi->dlh, 
TSREMAP_FUNCNAME_DONE);
-    pi->fptsremap_new_instance = (remap_plugin_info::_tsremap_new_instance *) 
dlsym(pi->dlh, TSREMAP_FUNCNAME_NEW_INSTANCE);
+    pi->fp_tsremap_new_instance = (remap_plugin_info::_tsremap_new_instance *) 
dlsym(pi->dlh, TSREMAP_FUNCNAME_NEW_INSTANCE);
     pi->fp_tsremap_delete_instance = 
(remap_plugin_info::_tsremap_delete_instance *) dlsym(pi->dlh, 
TSREMAP_FUNCNAME_DELETE_INSTANCE);
     pi->fp_tsremap_do_remap = (remap_plugin_info::_tsremap_do_remap *) 
dlsym(pi->dlh, TSREMAP_FUNCNAME_DO_REMAP);
     pi->fp_tsremap_os_response = (remap_plugin_info::_tsremap_os_response *) 
dlsym(pi->dlh, TSREMAP_FUNCNAME_OS_RESPONSE);
@@ -1675,7 +1675,7 @@ UrlRewrite::load_remap_plugin(char *argv
     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->fptsremap_new_instance) {
+    } else if (!pi->fp_tsremap_new_instance) {
       snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin 
\"%s\"",
                    TSREMAP_FUNCNAME_NEW_INSTANCE, c);
       retcode = -11;
@@ -1751,7 +1751,7 @@ UrlRewrite::load_remap_plugin(char *argv
   void* ih;
 
   Debug("remap_plugin", "creating new plugin instance");
-  TSReturnCode res = pi->fptsremap_new_instance(parc, parv, &ih, tmpbuf, 
sizeof(tmpbuf) - 1);
+  TSReturnCode res = pi->fp_tsremap_new_instance(parc, parv, &ih, tmpbuf, 
sizeof(tmpbuf) - 1);
 
   Debug("remap_plugin", "done creating new plugin instance");
 
@@ -1759,21 +1759,9 @@ UrlRewrite::load_remap_plugin(char *argv
   ats_free(parv[1]);               // toURL
 
   if (res != TS_SUCCESS) {
-    // TODO: This is such serious failure, no reason to try to delete the 
instance.
-    // mp->delete_instance(pi);
     snprintf(errbuf, errbufsize, "Can't create new remap instance for plugin 
\"%s\" - %s", c,
                  tmpbuf[0] ? tmpbuf : "Unknown plugin error");
-    Error("Failed to create new instance for plugin %s (non-zero retval)... 
bailing out", pi->path);
-                /**
-                * fail here, otherwise we *will* fail later
-                * and that's some jacked backtrace inside CreateTableLookup 
[see bug 2316658]
-                * at least this one will be obvious
-                * We *really* don't want to continue when a plugin failed to 
init. We can't
-                * guarantee we are remapping what the user thought we were 
going to remap.
-                * using something nice like exit() would be more ideal, but 
this should be
-                * caught in development, anyway.
-     **/
-    exit(-1);
+    Warning("Failed to create new instance for plugin %s (not a TS_SUCCESS 
return)", pi->path);
     return -6;
   }
 


Reply via email to