rem: connPtr->servPtr = servPtr;
context: CreatePool(NsServer *servPtr, char *pool){    ConnPool *poolPtr;    Conn *connBufPtr, *connPtr;    int i, n, maxconns;    char *path;    Ns_Set *set;    poolPtr = ns_calloc(1, sizeof(ConnPool));    poolPtr->pool = pool;    poolPtr->servPtr = servPtr;    if (*pool == '\0') {	/* NB: Default options from pre-4.0 ns/server/server1 section. */    	path = Ns_ConfigGetPath(servPtr->server, NULL, NULL);	servPtr->pools.defaultPtr= poolPtr;    } else {	/*	 * Map requested method/URL's to this pool.	 */    	path = Ns_ConfigGetPath(servPtr->server, NULL, "pool", pool, NULL);    	set = Ns_ConfigGetSection(path);	for (i = 0; set != NULL && i < Ns_SetSize(set); ++i) {	    if (!strcasecmp(Ns_SetKey(set, i), "map")) {		NsMapPool(poolPtr, Ns_SetValue(set, i));	    }	}    }    poolPtr->nextPtr = servPtr->pools.firstPtr;    servPtr->pools.firstPtr = poolPtr;    /*     * Pre-allocate all available connection structures to avoid having     * to repeatedly allocate and free them at run time and to ensure there     * is a per-set maximum number of simultaneous connections to handle     * before NsQueueConn begins to return NS_ERROR.     */    if (!Ns_ConfigGetInt(path, "maxconnections", &maxconns)) {	maxconns = 100;    }    connBufPtr = ns_calloc((size_t) maxconns, sizeof(Conn));    for (n = 0; n < maxconns - 1; ++n) {	connPtr = &connBufPtr[n];	connPtr->nextPtr = &connBufPtr[n+1];	connPtr->servPtr = servPtr;    }    connBufPtr[n].nextPtr = NULL;    poolPtr->queue.freePtr = &connBufPtr[0];    if (!Ns_ConfigGetInt(path, "minthreads", &poolPtr->threads.min)) {	poolPtr->threads.min = 0;    }    if (!Ns_ConfigGetInt(path, "maxthreads", &poolPtr->threads.max)) {	poolPtr->threads.max = 10;    }    if (!Ns_ConfigGetInt(path, "threadtimeout", &poolPtr->threads.timeout)) {	poolPtr->threads.timeout = 120;    }    /*     * Determine the minimum and maximum number of threads, adjusting the     * values as needed.  The threadtimeout value is the maximum number of     * seconds a thread will wait for a connection before exiting if the     * current number of threads is above the minimum.     */    if (poolPtr->threads.max > maxconns) {	Ns_Log(Warning, "serv: cannot have more maxthreads than maxconns: "	       "%d max threads adjusted down to %d max connections",	       poolPtr->threads.max, maxconns);	poolPtr->threads.max = maxconns;    }    if (poolPtr->threads.min > poolPtr->threads.max) {	Ns_Log(Warning, "serv: cannot have more minthreads than maxthreads: "	       "%d min threads adjusted down to %d max threads",	       poolPtr->threads.min, poolPtr->threads.max);	poolPtr->threads.min = poolPtr->threads.max;    }    if (!Ns_ConfigGetInt(path, "minthreads", &poolPtr->threads.min)) {	poolPtr->threads.min = 0;    }    if (!Ns_ConfigGetInt(path, "maxthreads", &poolPtr->threads.max)) {	poolPtr->threads.max = 10;    }    if (!Ns_ConfigGetInt(path, "threadtimeout", &poolPtr->threads.timeout)) {	poolPtr->threads.timeout = 120;    }    /*     * Determine the minimum and maximum number of threads, adjusting the     * values as needed.  The threadtimeout value is the maximum number of     * seconds a thread will wait for a connection before exiting if the     * current number of threads is above the minimum.     */    if (poolPtr->threads.max > maxconns) {	Ns_Log(Warning, "serv: cannot have more maxthreads than maxconns: "	       "%d max threads adjusted down to %d max connections",	       poolPtr->threads.max, maxconns);	poolPtr->threads.max = maxconns;    }    if (poolPtr->threads.min > poolPtr->threads.max) {	Ns_Log(Warning, "serv: cannot have more minthreads than maxthreads: "	       "%d min threads adjusted down to %d max threads",	       poolPtr->threads.min, poolPtr->threads.max);	poolPtr->threads.min = poolPtr->threads.max;    }}