提交 8ee7579d authored 作者: Michael Jerris's avatar Michael Jerris

Fri Mar 7 11:42:18 EST 2008 Pekka.Pessi@nokia.com

  * auth_module.c: calculating proper size for user data hash table.



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7818 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 f3a77abc
...@@ -1033,7 +1033,8 @@ int auth_readdb_internal(auth_mod_t *am, int always) ...@@ -1033,7 +1033,8 @@ int auth_readdb_internal(auth_mod_t *am, int always)
N = i, i = 0; N = i, i = 0;
if (N > 0) { if (N > 0) {
if (auth_htable_resize(am->am_home, am->am_users, N) < 0 || size_t size = (N * 5 + 3) / 4;
if (auth_htable_resize(am->am_home, am->am_users, size) < 0 ||
!(fresh = su_zalloc(am->am_home, sizeof(*fresh) * N))) { !(fresh = su_zalloc(am->am_home, sizeof(*fresh) * N))) {
su_free(am->am_home, buffer); su_free(am->am_home, buffer);
return -1; return -1;
...@@ -1134,7 +1135,7 @@ int auth_readdb_internal(auth_mod_t *am, int always) ...@@ -1134,7 +1135,7 @@ int auth_readdb_internal(auth_mod_t *am, int always)
return -1; return -1;
} }
/** Append to hash, remove existing user */ /** Append to hash, remove existing local user */
su_inline void su_inline void
auth_htable_append_local(auth_htable_t *aht, auth_passwd_t *apw) auth_htable_append_local(auth_htable_t *aht, auth_passwd_t *apw)
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论