@@ -199,45 +199,57 @@ acct_rtcp_enqueue(const struct pkt_proc_ctx *pktx)
199199 return (PPROC_ACT_TEE );
200200}
201201
202+ static const struct rtpp_minfo *
203+ rtpp_modules_lookup (struct rtpp_module_if * self , const char * mpath , struct rtpp_log * log )
204+ {
205+ const struct rtpp_minfo * mip = NULL ;
206+
207+ const char * derr ;
208+ int dlflags = RTLD_NOW | (is_gcov_on () ? RTLD_NODELETE : 0 );
209+ void * dmp = dlopen (mpath , dlflags );
210+ if (dmp == NULL ) {
211+ derr = dlerror ();
212+ if (strstr (derr , mpath ) == NULL ) {
213+ RTPP_LOG (log , RTPP_LOG_ERR , "can't dlopen(%s): %s" , mpath , derr );
214+ } else {
215+ RTPP_LOG (log , RTPP_LOG_ERR , "can't dlopen() module: %s" , derr );
216+ }
217+ goto e1 ;
218+ }
219+ RTPP_OBJ_DTOR_ATTACH_s (self , dlclose , dmp );
220+ mip = dlsym (dmp , "rtpp_module" );
221+ if (mip == NULL ) {
222+ derr = dlerror ();
223+ if (strstr (derr , mpath ) == NULL ) {
224+ RTPP_LOG (log , RTPP_LOG_ERR , "can't find 'rtpp_module' symbol in the %s"
225+ ": %s" , mpath , derr );
226+ } else {
227+ RTPP_LOG (log , RTPP_LOG_ERR , "can't find 'rtpp_module' symbol: %s" ,
228+ derr );
229+ }
230+ goto e1 ;
231+ }
232+ return (mip );
233+ e1 :
234+ return (NULL );
235+ }
236+
237+
202238static int
203239rtpp_mif_load (struct rtpp_module_if * self , const struct rtpp_cfg * cfsp , struct rtpp_log * log )
204240{
205241 struct rtpp_module_if_priv * pvt ;
206- const char * derr ;
207242 const struct rtpp_minfo * mip = NULL ;
208243
209244 PUB2PVT (self , pvt );
210- if (rtpp_is_lib ) {
245+
246+ if (rtpp_use_smodules ) {
211247 mip = rtpp_static_modules_lookup (pvt -> mpath );
212- if (mip == NULL )
213- goto e1 ;
214- }
215- if (mip == NULL ) {
216- int dlflags = RTLD_NOW | (is_gcov_on () ? RTLD_NODELETE : 0 );
217- void * dmp = dlopen (pvt -> mpath , dlflags );
218- if (dmp == NULL ) {
219- derr = dlerror ();
220- if (strstr (derr , pvt -> mpath ) == NULL ) {
221- RTPP_LOG (log , RTPP_LOG_ERR , "can't dlopen(%s): %s" , pvt -> mpath , derr );
222- } else {
223- RTPP_LOG (log , RTPP_LOG_ERR , "can't dlopen() module: %s" , derr );
224- }
225- goto e1 ;
226- }
227- RTPP_OBJ_DTOR_ATTACH_s (& (pvt -> pub ), dlclose , dmp );
228- mip = dlsym (dmp , "rtpp_module" );
229- if (mip == NULL ) {
230- derr = dlerror ();
231- if (strstr (derr , pvt -> mpath ) == NULL ) {
232- RTPP_LOG (log , RTPP_LOG_ERR , "can't find 'rtpp_module' symbol in the %s"
233- ": %s" , pvt -> mpath , derr );
234- } else {
235- RTPP_LOG (log , RTPP_LOG_ERR , "can't find 'rtpp_module' symbol: %s" ,
236- derr );
237- }
238- goto e1 ;
239- }
248+ } else {
249+ mip = rtpp_modules_lookup (self , pvt -> mpath , log );
240250 }
251+ if (mip == NULL )
252+ goto e1 ;
241253
242254 if (!MI_VER_CHCK (mip ) || mip -> fn == NULL ) {
243255 RTPP_LOG (log , RTPP_LOG_ERR , "incompatible API version in the %s, "
0 commit comments