/* This file is part of Metaproxy.
- Copyright (C) 2005-2012 Index Data
+ Copyright (C) 2005-2013 Index Data
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
"unable to open content config %s",
m_p->content_config_file.c_str());
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
- *addinfo = (char *) odr_malloc(odr, 60 + tmp_file.length());
- sprintf(*addinfo, "unable to open content config %s",
+ *addinfo = (char *) odr_malloc(odr, 70 + tmp_file.length());
+ sprintf(*addinfo, "zoom: unable to open content config %s",
m_p->content_config_file.c_str());
return false;
}
package.log("zoom", YLOG_WARN, "bad tmp_file %s", tmp_file.c_str());
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
*addinfo = (char *) odr_malloc(odr, 60 + tmp_file.length());
- sprintf(*addinfo, "bad format of content tmp_file: %s",
+ sprintf(*addinfo, "zoom: bad format of content tmp_file: %s",
tmp_file.c_str());
xfree(fname);
return false;
{
package.log("zoom", YLOG_WARN|YLOG_ERRNO, "create %s", fname);
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
- *addinfo = (char *) odr_malloc(odr, 40 + strlen(fname));
- sprintf(*addinfo, "Could not create %s", fname);
+ *addinfo = (char *) odr_malloc(odr, 50 + strlen(fname));
+ sprintf(*addinfo, "zoom: could not create %s", fname);
xfree(fname);
return false;
}
BackendPtr notfound;
char *msg = (char*) odr_malloc(odr, strlen(name) + 30);
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
- sprintf(msg, "Bad database argument: %s", name);
+ sprintf(msg, "zoom: bad database argument: %s", name);
*addinfo = msg;
return notfound;
}
if (!xsp_doc)
{
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
- *addinfo = (char *) odr_malloc(odr, 40);
- sprintf(*addinfo, "xmlParseMemory failed");
+ *addinfo = odr_strdup(odr, "zoom: xmlParseMemory failed "
+ "for literalTransform XSL");
BackendPtr b;
return b;
}
if (!xsp)
{
*error = YAZ_BIB1_DATABASE_DOES_NOT_EXIST;
- *addinfo = odr_strdup(odr, "xsltParseStylesheetDoc failed");
+ *addinfo =
+ odr_strdup(odr,"zoom: xsltParseStylesheetDoc failed "
+ "for literalTransform XSL");
BackendPtr b;
xmlFreeDoc(xsp_doc);
return b;
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
*addinfo = (char *)
odr_malloc(odr, 40 + sptr->transform_xsl_fname.length());
- sprintf(*addinfo, "File could not be read: %s",
+ sprintf(*addinfo, "zoom: could not open file %s",
sptr->transform_xsl_fname.c_str());
BackendPtr b;
return b;
if (!xsp_doc)
{
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
- *addinfo = (char *) odr_malloc(odr, 40 + fname.length());
- sprintf(*addinfo, "xmlParseFile failed. File: %s", fname.c_str());
+ *addinfo = (char *) odr_malloc(odr, 50 + fname.length());
+ sprintf(*addinfo, "zoom: xmlParseFile failed for file %s",
+ fname.c_str());
BackendPtr b;
return b;
}
xsp = xsltParseStylesheetDoc(xsp_doc);
if (!xsp)
{
- *error = YAZ_BIB1_DATABASE_DOES_NOT_EXIST;
- *addinfo = odr_strdup(odr, "xsltParseStylesheetDoc failed");
+ *error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
+ *addinfo = (char *) odr_malloc(odr, 50 + fname.length());
+ sprintf(*addinfo, "zoom: xsltParseStylesheetDoc failed "
+ "for file %s", fname.c_str());
BackendPtr b;
xmlFreeDoc(xsp_doc);
return b;
if (!cqlt)
{
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
- *addinfo = odr_strdup(odr, "Missing/invalid cql2rpn file");
+ *addinfo = odr_strdup(odr, "zoom: missing/invalid cql2rpn file");
BackendPtr b;
xsltFreeStylesheet(xsp);
return b;
if (proxy.length())
b->set_option("proxy", proxy);
}
- std::string url;
+ std::string url(sptr->target);
if (sptr->sru.length())
{
- url = "http://" + sptr->target;
b->set_option("sru", sptr->sru);
-
+ if (url.find("://") == std::string::npos)
+ url = "http://" + url;
if (sptr->sru_version.length())
b->set_option("sru_version", sptr->sru_version);
}
- else
- {
- url = sptr->target;
- }
if (no_out_args)
{
char *x_args = 0;
if (status)
{
error = YAZ_BIB1_MALFORMED_QUERY;
- const char *addinfo = "can not convert from RPN to CQL/SOLR";
+ const char *addinfo = "can not convert from RPN to CQL/Solr";
log_diagnostic(package, error, addinfo);
apdu_res = odr.create_searchResponse(apdu_req, error, addinfo);
package.response() = apdu_res;
{
// something fundamental broken in lookup.
*error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
- *addinfo = odr_strdup(odr, "Torus server unavailable or "
- "incorrectly configured");
+ *addinfo = odr_strdup(odr, "zoom: torus server unavailable or "
+ "incorrectly configured.");
return;
}
const xmlNode *ptr = xmlDocGetRootElement(doc);