瀏覽代碼

app_lua: detect if a kemi function was already added in the exports list

(cherry picked from commit d98a005ac57b957231f8bda26c711bf7c7260049)
(cherry picked from commit 7093572c5ca65f805e4421d6d821eb06dd1a6dcd)
Daniel-Constantin Mierla 7 年之前
父節點
當前提交
04a858667c
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/modules/app_lua/app_lua_kemi_export.c

+ 3 - 0
src/modules/app_lua/app_lua_kemi_export.c

@@ -9281,6 +9281,9 @@ lua_CFunction sr_kemi_lua_export_associate(sr_kemi_t *ket)
 			_sr_kemi_lua_export_list[i].ket = ket;
 			return _sr_kemi_lua_export_list[i].pfunc;
 		}
+		if(_sr_kemi_lua_export_list[i].ket==ket) {
+			return _sr_kemi_lua_export_list[i].pfunc;
+		}
 	}
 	LM_ERR("no more indexing slots\n");
 	return NULL;