Fix problem with fix-up referenceId's. Keep-alive when receiving SIGBUS.
+--- 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.
--- 0.7.6 2004/02/05 Internal release.
Force correct referenceID's.
-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,
Permission to use, copy, modify, distribute, and sell this software and
its documentation, in whole or in part, for any purpose, is hereby granted,
-AM_INIT_AUTOMAKE("yaz++",0.7.6)
+AM_INIT_AUTOMAKE("yaz++",0.7.7)
* Copyright (c) 1998-2004, Index Data.
* See the file LICENSE for details.
*
* 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 $
struct timeval m_time_tv;
void logtime();
Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema);
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);
public:
Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable,
Yaz_Proxy *parent = 0);
* Copyright (c) 1998-2004, Index Data.
* See the file LICENSE for details.
*
* 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 $
yaz_log(LOG_WARN, "Received SIGSEGV from child %ld", (long) p);
cont = 1;
break;
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);
case SIGTERM:
yaz_log(LOG_LOG, "Received SIGTERM from child %ld",
(long) p);
* Copyright (c) 1998-2004, Index Data.
* See the file LICENSE for details.
*
* 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 $
m_request_no = 0;
m_invalid_session = 0;
m_referenceId = 0;
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;
m_config = 0;
m_marcxml_flag = 0;
m_stylesheet_xsp = 0;
m_bytes_sent, m_bytes_recv);
nmem_destroy(m_initRequest_mem);
nmem_destroy(m_mem_invalid_session);
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);
xfree (m_proxyTarget);
xfree (m_default_target);
xfree (m_proxy_authentication);
Z_ReferenceId **new_id = get_referenceIdP(apdu);
if (new_id && m_referenceId)
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)
{
if (apdu->which == Z_APDU_searchResponse)
{
void Yaz_Proxy::handle_incoming_Z_PDU(Z_APDU *apdu)
{
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;
if (!m_client && m_invalid_session)
{
m_apdu_invalid_session = apdu;
apdu = m_initRequest_apdu;
}
apdu = m_initRequest_apdu;
}
- m_referenceId = get_referenceIdP(apdu);
-
// Determine our client.
Z_OtherInformation **oi;
get_otherInfoAPDU(apdu, &oi);
// Determine our client.
Z_OtherInformation **oi;
get_otherInfoAPDU(apdu, &oi);