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
Start work on 1line log (ala GFS)
[metaproxy-moved-to-github.git]
/
src
/
filter_record_transform.cpp
diff --git
a/src/filter_record_transform.cpp
b/src/filter_record_transform.cpp
index
f6ddac0
..
a7cb28c
100644
(file)
--- a/
src/filter_record_transform.cpp
+++ b/
src/filter_record_transform.cpp
@@
-26,6
+26,8
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <yaz/zgdu.h>
#include <yaz/retrieval.h>
#include <yaz/zgdu.h>
#include <yaz/retrieval.h>
+#include <boost/thread/mutex.hpp>
+
#if HAVE_USEMARCON
#include <usemarconlib.h>
#include <defines.h>
#if HAVE_USEMARCON
#include <usemarconlib.h>
#include <defines.h>
@@
-53,6
+55,8
@@
namespace metaproxy_1 {
#if HAVE_USEMARCON
struct info_usemarcon {
#if HAVE_USEMARCON
struct info_usemarcon {
+ boost::mutex m_mutex;
+
char *stage1;
char *stage2;
char *stage1;
char *stage2;
@@
-64,6
+68,8
@@
static int convert_usemarcon(void *info, WRBUF record, WRBUF wr_error)
{
struct info_usemarcon *p = (struct info_usemarcon *) info;
{
struct info_usemarcon *p = (struct info_usemarcon *) info;
+ boost::mutex::scoped_lock lock(p->m_mutex);
+
if (p->usemarcon1)
{
char *converted;
if (p->usemarcon1)
{
char *converted;
@@
-108,7
+114,7
@@
static void destroy_usemarcon(void *info)
delete p->usemarcon2;
xfree(p->stage1);
xfree(p->stage2);
delete p->usemarcon2;
xfree(p->stage1);
xfree(p->stage2);
- xfree(p);
+ delete p;
}
static void *construct_usemarcon(const xmlNode *ptr, const char *path,
}
static void *construct_usemarcon(const xmlNode *ptr, const char *path,
@@
-118,7
+124,7
@@
static void *construct_usemarcon(const xmlNode *ptr, const char *path,
if (strcmp((const char *) ptr->name, "usemarcon"))
return 0;
if (strcmp((const char *) ptr->name, "usemarcon"))
return 0;
- struct info_usemarcon *p = (struct info_usemarcon *) xmalloc(sizeof(*p));
+ struct info_usemarcon *p = new(struct info_usemarcon);
p->stage1 = 0;
p->stage2 = 0;
p->usemarcon1 = 0;
p->stage1 = 0;
p->stage2 = 0;
p->usemarcon1 = 0;
@@
-455,7
+461,7
@@
void yf::RecordTransform::Impl::process(mp::Package &package) const
Z_NamePlusRecord *npr = records->records[i];
if (npr->which == Z_NamePlusRecord_databaseRecord)
{
Z_NamePlusRecord *npr = records->records[i];
if (npr->which == Z_NamePlusRecord_databaseRecord)
{
- WRBUF output_record = wrbuf_alloc();
+ mp::wrbuf output_record;
Z_External *r = npr->u.databaseRecord;
int ret_trans = 0;
if (r->which == Z_External_OPAC)
Z_External *r = npr->u.databaseRecord;
int ret_trans = 0;
if (r->which == Z_External_OPAC)
@@
-476,8
+482,8
@@
void yf::RecordTransform::Impl::process(mp::Package &package) const
{
npr->u.databaseRecord =
z_ext_record_oid(odr_en, match_syntax,
{
npr->u.databaseRecord =
z_ext_record_oid(odr_en, match_syntax,
- wrbuf_buf(output_record),
- wrbuf_len(output_record));
+ output_record.buf(),
+ output_record.len());
}
else
{
}
else
{
@@
-487,7
+493,6
@@
void yf::RecordTransform::Impl::process(mp::Package &package) const
YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS,
yaz_record_conv_get_error(rc));
}
YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS,
yaz_record_conv_get_error(rc));
}
- wrbuf_destroy(output_record);
}
}
package.response() = gdu_res;
}
}
package.response() = gdu_res;