106{
107#if HAVE_DLFCN_H
108 if (
m_p->m_fcm.find(fi) !=
m_p->m_fcm.end())
109 {
110 return true;
111 }
112 std::string full_name = "metaproxy_1_filter_" + fi;
113
114 void *dl_handle = dlopen(0, RTLD_GLOBAL|RTLD_NOW);
115 void *dlsym_ptr = dlsym(dl_handle, full_name.c_str());
116
117 if (!dlsym_ptr)
118 {
119 std::string full_path = path + "/metaproxy_filter_" + fi + ".so";
120 dl_handle = dlopen(full_path.c_str(), RTLD_GLOBAL|RTLD_NOW);
121 if (!dl_handle)
122 {
123 const char *dl = dlerror();
124 std::cout << "dlopen " << full_path << " failed. dlerror=" << dl <<
125 std::endl;
126 return false;
127 }
128 dlsym_ptr = dlsym(dl_handle, full_name.c_str());
129 }
130 if (!dlsym_ptr)
131 {
132 std::cout << "dlsym " << full_name << " failed\n";
133 return false;
134 }
135 struct metaproxy_1_filter_struct *s = (struct metaproxy_1_filter_struct *) dlsym_ptr;
137#else
138 return false;
139#endif
140}