projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Configure from XML
[metaproxy-moved-to-github.git]
/
src
/
torus.cpp
diff --git
a/src/torus.cpp
b/src/torus.cpp
index
bd0a63b
..
828e4ac
100644
(file)
--- a/
src/torus.cpp
+++ b/
src/torus.cpp
@@
-1,5
+1,5
@@
/* This file is part of Metaproxy.
/* 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
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
@@
-53,7
+53,7
@@
xmlDoc *mp::get_searchable(mp::Package &package,
Z_HTTP_Header *http_headers = 0;
mp::odr odr;
Z_HTTP_Header *http_headers = 0;
mp::odr odr;
-
+
z_HTTP_header_add(odr, &http_headers, "Accept","application/xml");
yaz_url_t url_p = yaz_url_create();
z_HTTP_header_add(odr, &http_headers, "Accept","application/xml");
yaz_url_t url_p = yaz_url_create();
@@
-67,21
+67,28
@@
xmlDoc *mp::get_searchable(mp::Package &package,
0, /* content buf */
0 /* content_len */
);
0, /* content buf */
0 /* content_len */
);
- if (http_response && http_response->code == 200 &&
+ if (http_response && http_response->code == 200 &&
http_response->content_buf)
{
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);
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
{
}
else
{
- package.log("zoom", YLOG_WARN, "Torus: %s FAIL", url_template.c_str());
if (http_response)
{
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)
}
if (http_response && http_response->content_buf)