From ab004a9c8d93f4f906ce643e306efe9dece8a2ce Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 10 Feb 2004 15:02:19 +0000 Subject: [PATCH] Bump version. Fix problem with fix-up referenceId's. Keep-alive when receiving SIGBUS. --- ChangeLog | 6 ++++++ LICENSE | 2 +- configure.in | 2 +- include/yaz++/proxy.h | 5 +++-- src/yaz-proxy-main.cpp | 8 ++++++-- src/yaz-proxy.cpp | 23 +++++++++++++++++++---- 6 files changed, 36 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6f074f..4c32fe0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ +--- 0.7.7 2004/02/10 Internal release. + +Make proxy perform keepalive when receiving SIGBUS. + +Fix problem with fixup of referenceId's. + --- 0.7.6 2004/02/05 Internal release. Force correct referenceID's. diff --git a/LICENSE b/LICENSE index 507be71..edb61b4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 1999-2002, Index Data and Mike Taylor. +Copyright (c) 1999-2004, Index Data and Mike Taylor. Permission to use, copy, modify, distribute, and sell this software and its documentation, in whole or in part, for any purpose, is hereby granted, diff --git a/configure.in b/configure.in index 0363baf..b170663 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT(configure.in) -AM_INIT_AUTOMAKE("yaz++",0.7.6) +AM_INIT_AUTOMAKE("yaz++",0.7.7) AC_PROG_CC AC_PROG_CPP diff --git a/include/yaz++/proxy.h b/include/yaz++/proxy.h index 0cbe124..649e0a2 100644 --- a/include/yaz++/proxy.h +++ b/include/yaz++/proxy.h @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: proxy.h,v 1.38 2004-02-02 15:11:40 adam Exp $ + * $Id: proxy.h,v 1.39 2004-02-10 15:02:19 adam Exp $ */ #include @@ -281,7 +281,8 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { struct timeval m_time_tv; void logtime(); Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema); - Z_ReferenceId **m_referenceId; + Z_ReferenceId *m_referenceId; + NMEM m_referenceId_mem; public: Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable, Yaz_Proxy *parent = 0); diff --git a/src/yaz-proxy-main.cpp b/src/yaz-proxy-main.cpp index 614dfa0..03c0f61 100644 --- a/src/yaz-proxy-main.cpp +++ b/src/yaz-proxy-main.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy-main.cpp,v 1.31 2004-01-30 01:30:30 adam Exp $ + * $Id: yaz-proxy-main.cpp,v 1.32 2004-02-10 15:02:19 adam Exp $ */ #include @@ -256,6 +256,10 @@ int main(int argc, char **argv) yaz_log(LOG_WARN, "Received SIGSEGV from child %ld", (long) p); cont = 1; break; + case SIGBUS: + yaz_log(LOG_WARN, "Received SIGBUS from child %ld", (long) p); + cont = 1; + break; case SIGTERM: yaz_log(LOG_LOG, "Received SIGTERM from child %ld", (long) p); @@ -275,7 +279,7 @@ int main(int argc, char **argv) cont = 1; } if (cont) - sleep(1); + sleep(1 + run/5); run++; } exit (0); diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 0e423d9..872cee6 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy.cpp,v 1.97 2004-02-02 15:11:41 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.98 2004-02-10 15:02:19 adam Exp $ */ #include @@ -101,6 +101,7 @@ Yaz_Proxy::Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable, m_request_no = 0; m_invalid_session = 0; m_referenceId = 0; + m_referenceId_mem = nmem_create(); m_config = 0; m_marcxml_flag = 0; m_stylesheet_xsp = 0; @@ -133,6 +134,8 @@ Yaz_Proxy::~Yaz_Proxy() m_bytes_sent, m_bytes_recv); nmem_destroy(m_initRequest_mem); nmem_destroy(m_mem_invalid_session); + nmem_destroy(m_referenceId_mem); + xfree (m_proxyTarget); xfree (m_default_target); xfree (m_proxy_authentication); @@ -982,7 +985,7 @@ int Yaz_Proxy::send_to_client(Z_APDU *apdu) Z_ReferenceId **new_id = get_referenceIdP(apdu); if (new_id && m_referenceId) - *new_id = *m_referenceId; + *new_id = m_referenceId; if (apdu->which == Z_APDU_searchResponse) { @@ -1917,6 +1920,20 @@ void Yaz_Proxy::handle_incoming_HTTP(Z_HTTP_Request *hreq) void Yaz_Proxy::handle_incoming_Z_PDU(Z_APDU *apdu) { + Z_ReferenceId **refid = get_referenceIdP(apdu); + nmem_reset(m_referenceId_mem); + if (refid && *refid) + { + m_referenceId = (Z_ReferenceId *) + nmem_malloc(m_referenceId_mem, sizeof(*m_referenceId)); + m_referenceId->len = m_referenceId->size = (*refid)->len; + m_referenceId->buf = (unsigned char *) + nmem_malloc(m_referenceId_mem, (*refid)->len); + memcpy(m_referenceId->buf, (*refid)->buf, (*refid)->len); + } + else + m_referenceId = 0; + if (!m_client && m_invalid_session) { m_apdu_invalid_session = apdu; @@ -1924,8 +1941,6 @@ void Yaz_Proxy::handle_incoming_Z_PDU(Z_APDU *apdu) apdu = m_initRequest_apdu; } - m_referenceId = get_referenceIdP(apdu); - // Determine our client. Z_OtherInformation **oi; get_otherInfoAPDU(apdu, &oi); -- 1.7.10.4