Пример #1
0
void msgq::init(unsigned qs)
{
	queue.resize(qs);
	queuehashfirst.resize(qs);
	queuehashlast.resize(qs);

	queuehead=0;
	queuetail=0;
	queuefree=0;
	queuedelivering=0;
	queuewaiting=0;
	inprogress=0;
	backup_relay_driver=0;

char *filename=config_localfilename("backuprelay");
char *buf=config_read1l(filename);

	free(filename);
	if (buf)
	{
		const char *h=strtok(buf, " \t\r\n");

		if (h)
		{
			backup_relay=h;
			h=strtok(0, " \t\r\n");
			if (!h)	h="esmtp";

		struct rw_transport *t=rw_search_transport(h);

			if (!t)
			{
				clog_msg_start_err();
				clog_msg_str("BACKUP RELAY DRIVER NOT FOUND: ");
				clog_msg_str(h);
				clog_msg_send();
				exit(1);
			}
			backup_relay_driver=(drvinfo *)t->udata;
		}
	}

unsigned	i;

	for (i=0; i<qs; i++)
	{
		queue[i].next=queuefree;
		queuefree=&queue[i];
		queuehashfirst[i]=0;
		queuehashlast[i]=0;
	}
}
Пример #2
0
const char *dsn_rw_init()
{
    local=rw_search_transport("local");
    return (0);
}