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
More news
[metaproxy-moved-to-github.git]
/
src
/
filter_virt_db.cpp
diff --git
a/src/filter_virt_db.cpp
b/src/filter_virt_db.cpp
index
aca2634
..
56ba946
100644
(file)
--- a/
src/filter_virt_db.cpp
+++ b/
src/filter_virt_db.cpp
@@
-1,5
+1,5
@@
/* This file is part of Metaproxy.
/* This file is part of Metaproxy.
- Copyright (C) 2005-2009 Index Data
+ Copyright (C) 2005-2010 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
@@
-18,15
+18,14
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "config.hpp"
#include "config.hpp"
-#include "filter.hpp"
-#include "package.hpp"
+#include "filter_virt_db.hpp"
+#include <metaproxy/package.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <boost/shared_ptr.hpp>
-#include "util.hpp"
-#include "filter_virt_db.hpp"
+#include <metaproxy/util.hpp>
#include <yaz/zgdu.h>
#include <yaz/otherinfo.h>
#include <yaz/zgdu.h>
#include <yaz/otherinfo.h>
@@
-236,31
+235,24
@@
yf::VirtualDB::BackendPtr yf::VirtualDB::Frontend::init_backend(
{
b->m_named_result_sets = true;
}
{
b->m_named_result_sets = true;
}
- if (!*res->result)
+ if (*res->result)
{
{
- error_code = YAZ_BIB1_DATABASE_UNAVAILABLE;
- mp::util::get_init_diagnostics(res, error_code, addinfo);
- BackendPtr null;
- return null;
+ m_backend_list.push_back(b);
+ return b;
+
}
}
- }
- else
- {
error_code = YAZ_BIB1_DATABASE_UNAVAILABLE;
error_code = YAZ_BIB1_DATABASE_UNAVAILABLE;
- // addinfo = database;
- BackendPtr null;
- return null;
- }
- if (init_package.session().is_closed())
+ mp::util::get_init_diagnostics(res, error_code, addinfo);
+ }
+ if (!init_package.session().is_closed())
{
{
- error_code = YAZ_BIB1_DATABASE_UNAVAILABLE;
- // addinfo = database;
- BackendPtr null;
- return null;
+ Package close_package(b->m_backend_session, package.origin());
+ close_package.copy_filter(package);
+ close_package.session().close();
+ close_package.move(b->m_route); // closing it
}
}
-
- m_backend_list.push_back(b);
- return b;
+ BackendPtr null;
+ return null;
}
void yf::VirtualDB::Frontend::search(mp::Package &package, Z_APDU *apdu_req)
}
void yf::VirtualDB::Frontend::search(mp::Package &package, Z_APDU *apdu_req)