/* This file is part of Metaproxy.
- Copyright (C) 2005-2012 Index Data
+ Copyright (C) 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
std::string url_template, const std::string &db,
const std::string &query,
const std::string &realm,
- const std::string &proxy)
+ const std::string &proxy,
+ std::string &addinfo)
{
// http://mk2.indexdata.com/torus2/searchable/records/?query=udb%3d%db
// or
if (http_response && http_response->code == 200 &&
http_response->content_buf)
{
- package.log("zoom", YLOG_LOG, "Torus: %s OK", url_template.c_str());
doc = xmlParseMemory(http_response->content_buf,
http_response->content_len);
-
+ if (doc)
+ package.log("zoom", YLOG_LOG, "Torus: %s OK",
+ url_template.c_str());
+ else
+ {
+ package.log("zoom", YLOG_WARN, "Torus: %s FAIL. XML parse failed",
+ url_template.c_str());
+ addinfo = "Torus: XML parse failed";
+ }
}
else
{
- package.log("zoom", YLOG_WARN, "Torus: %s FAIL", url_template.c_str());
+ addinfo = "Torus: ";
if (http_response)
{
- package.log("zoom", YLOG_LOG, "HTTP code: %d", http_response->code);
+ package.log("zoom", YLOG_WARN, "Torus: %s FAIL. HTTP code %d",
+ url_template.c_str(), http_response->code);
+ addinfo += std::string(http_response->content_buf,
+ http_response->content_len);
+ }
+ else
+ {
+ addinfo += "unknown error";
+ package.log("zoom", YLOG_WARN, "Torus: %s FAIL. No HTTP response",
+ url_template.c_str());
}
}