Пример #1
0
char *find_free_server(void)
{
    const char *servers = config_getstring(IMAPOPT_SERVERLIST);
    char *server = NULL;

    if (servers) {
        if (!server_parts) {
            server_parts = xzmalloc(sizeof(partlist_t));

            partlist_initialize(
                    server_parts,
                    proxy_part_filldata,
                    NULL,
                    servers,
                    NULL,
                    partlist_getmode(config_getstring(IMAPOPT_SERVERLIST_SELECT_MODE)),
                    config_getint(IMAPOPT_SERVERLIST_SELECT_SOFT_USAGE_LIMIT),
                    config_getint(IMAPOPT_SERVERLIST_SELECT_USAGE_REINIT)
                );

        }

        server = (char *)partlist_select_value(server_parts);
    }

    return server;
}
Пример #2
0
static void partlist_local_init(void)
{
    if (partlist_local) {
	/* already done */
	return;
    }

    partlist_local = xzmalloc(sizeof(partlist_t));
    partlist_initialize(
	partlist_local,
	NULL,
	"partition-",
	NULL,
	config_getstring(IMAPOPT_PARTITION_SELECT_EXCLUDE),
	partlist_getmode(config_getstring(IMAPOPT_PARTITION_SELECT_MODE)),
	config_getint(IMAPOPT_PARTITION_SELECT_SOFT_USAGE_LIMIT),
	config_getint(IMAPOPT_PARTITION_SELECT_USAGE_REINIT)
    );
}