X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ftorus.cpp;h=828e4ac02efc92658dde21311a830d81ebffe3ac;hb=c271eb1db3286cd6c309f2cde33dc90d7c3c4dfe;hp=e286adf7e58b518600a20037f4b9ff6af36aca69;hpb=55248f83c4d706bc529873d01d3696388e816d32;p=metaproxy-moved-to-github.git diff --git a/src/torus.cpp b/src/torus.cpp index e286adf..828e4ac 100644 --- a/src/torus.cpp +++ b/src/torus.cpp @@ -1,5 +1,5 @@ /* 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 @@ -42,15 +42,6 @@ xmlDoc *mp::get_searchable(mp::Package &package, found = url_template.find("%query"); if (found != std::string::npos) url_template.replace(found, 6, mp::util::uri_encode(query)); - else - { - if (db.length() == 0) - { - package.log("zoom", YLOG_WARN, - "%query not defined in code == 200 && + 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()); } else { - package.log("zoom", YLOG_WARN, "Torus: %s FAIL", url_template.c_str()); 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); } + else + package.log("zoom", YLOG_WARN, "Torus: %s FAIL. No HTTP response", + url_template.c_str()); } if (http_response && http_response->content_buf)