case ZOOM_TASK_SEARCH:
yaz_log(YLOG_LOG, "search p=%p", task);
break;
- case ZOOM_TASK_RETRIEVE:
- yaz_log(YLOG_LOG, "retrieve p=%p", task);
- break;
case ZOOM_TASK_CONNECT:
yaz_log(YLOG_LOG, "connect p=%p", task);
break;
xfree(task->u.search.elementSetName);
xfree(task->u.search.schema);
break;
- case ZOOM_TASK_RETRIEVE:
- resultset_destroy(task->u.retrieve.resultset);
- xfree(task->u.retrieve.syntax);
- xfree(task->u.retrieve.elementSetName);
- xfree(task->u.retrieve.schema);
- break;
case ZOOM_TASK_CONNECT:
break;
case ZOOM_TASK_SCAN:
const char *host, int portnum)
{
const char *val;
+ const char *http_lead;
initlog();
else
c->lang = 0;
+ val = ZOOM_options_get(c->options, "sru");
+ if (val && *val && !strstr(host, "://"))
+ http_lead = "http://";
+ else
+ http_lead = "";
+ c->sru_mode = get_sru_mode_from_string(val);
+
if (host)
{
+ char hostn[128];
xfree(c->host_port);
if (portnum)
{
- char hostn[128];
sprintf(hostn, "%.80s:%d", host, portnum);
- c->host_port = xstrdup(hostn);
+ host = hostn;
}
- else
- c->host_port = xstrdup(host);
+ c->host_port = xmalloc(strlen(host) + strlen(http_lead) + 1);
+ strcpy(c->host_port, http_lead);
+ strcat(c->host_port, host);
}
{
}
}
- val = ZOOM_options_get(c->options, "sru");
- c->sru_mode = get_sru_mode_from_string(val);
-
xfree(c->sru_version);
val = ZOOM_options_get(c->options, "sru_version");
c->sru_version = xstrdup(val ? val : "1.2");
#endif
resultset_use(1);
r->mc_key = 0;
+ r->live_set = 0;
return r;
}
c->reconnect_ok = 1;
}
}
- task = ZOOM_connection_add_task(c, ZOOM_TASK_RETRIEVE);
- task->u.retrieve.resultset = r;
- task->u.retrieve.start = start;
- task->u.retrieve.count = count;
+ task = ZOOM_connection_add_task(c, ZOOM_TASK_SEARCH);
+ task->u.search.resultset = r;
+ task->u.search.start = start;
+ task->u.search.count = count;
syntax = ZOOM_options_get(r->options, "preferredRecordSyntax");
- task->u.retrieve.syntax = syntax ? xstrdup(syntax) : 0;
+ task->u.search.syntax = syntax ? xstrdup(syntax) : 0;
elementSetName = ZOOM_options_get(r->options, "elementSetName");
- task->u.retrieve.elementSetName = elementSetName
+ task->u.search.elementSetName = elementSetName
? xstrdup(elementSetName) : 0;
cp = ZOOM_options_get(r->options, "schema");
- task->u.retrieve.schema = cp ? xstrdup(cp) : 0;
+ task->u.search.schema = cp ? xstrdup(cp) : 0;
ZOOM_resultset_addref(r);
else
ret = ZOOM_connection_Z3950_send_search(c);
break;
- case ZOOM_TASK_RETRIEVE:
- if (c->proto == PROTO_HTTP)
- ret = ZOOM_connection_srw_send_search(c);
- else
- ret = send_Z3950_present(c);
- break;
case ZOOM_TASK_CONNECT:
ret = do_connect(c);
break;