- if (!where || sscanf(where, "%[^:]:%s", mode, addr) != 2)
- {
- yaz_log (LOG_WARN, "%s: Address format: ('tcp'|'osi')':'<address>", me);
- return;
- }
- if (!strcmp(mode, "tcp"))
- type = tcpip_type;
- else if (!strcmp(mode, "osi"))
- {
-#ifdef USE_XTIMOSI
- type = mosi_type;
-#else
- yaz_log (LOG_WARN, "OSI Transport not allowed by configuration.");
- return;
-#endif
- }
- else
- {
- yaz_log (LOG_WARN, "You must specify either 'osi:' or 'tcp:'");
- return;
- }
- yaz_log(LOG_LOG, "Adding %s %s listener on %s",
- control_block.dynamic ? "dynamic" :
- (control_block.threads ? "threaded" : "static"),
- what == PROTO_SR ? "SR" : "Z3950", where);
- if (!(l = cs_create(type, 0, what)))
- {
- yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to create listener");
- return;
- }
- ap = cs_straddr (l, addr);
- if (!ap)