Commit 07a43573 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Do revision 1.2 as isc-0-98 does it.

parent 4346a7b7
......@@ -27,23 +27,46 @@ isc_initialize(IscConfig * cfg)
IscMasterConfig * mcfg;
IscSessionConfig * scfg;
/* Make sure the mcb is allocated using the correct allocator. */
if (cfg && cfg->version == 1005 && cfg->master.version == 1001)
{
if (cfg->master.memfn.alloc && cfg->master.memfn.realloc
&& cfg->master.memfn.free)
{
isc_setallocfn(cfg->master.memfn.alloc,
cfg->master.memfn.realloc,
cfg->master.memfn.free);
}
/* Handle user specified defaults */
if (cfg)
switch (cfg->version)
{
case 0:
break;
case 1005:
mcfg = &cfg->master;
switch (mcfg->version)
{
case 0:
break;
case 1001:
if (mcfg->memfn.alloc &&
mcfg->memfn.realloc &&
mcfg->memfn.free)
isc_setallocfn(mcfg->memfn.alloc,
mcfg->memfn.realloc,
mcfg->memfn.free);
if (mcfg->abortfn)
isc_setabortfn(mcfg->abortfn);
break;
if (cfg->master.abortfn)
isc_setabortfn(cfg->master.abortfn);
}
default:
errno = EINVAL;
return NULL;
}
break;
default:
errno = EINVAL;
return NULL;
}
ISC_XNEW(mcb);
mcb->sessions = NULL;
......@@ -60,7 +83,6 @@ isc_initialize(IscConfig * cfg)
{
case 1005:
scfg = &cfg->session;
mcfg = &cfg->master;
switch (scfg->version)
{
......@@ -86,27 +108,6 @@ isc_initialize(IscConfig * cfg)
return NULL;
}
switch (mcfg->version)
{
case 0:
break;
case 1001:
if (mcfg->memfn.alloc &&
mcfg->memfn.realloc &&
mcfg->memfn.free)
isc_setallocfn(mcfg->memfn.alloc,
mcfg->memfn.realloc,
mcfg->memfn.free);
if (mcfg->abortfn)
isc_setabortfn(mcfg->abortfn);
break;
default:
isc_free(mcb);
errno = EINVAL;
return NULL;
}
break;
default:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment