From 72dafa4664643302f11c55ad4816e15b8765a3c2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 23 Oct 2003 08:46:55 +0000 Subject: [PATCH] Omit check for piggyback --- src/config.xml | 40 ++++++++++++++++------------- src/yaz-pdu-assoc.cpp | 12 +++++++-- src/yaz-proxy.cpp | 67 +++++++++++++++++++++++-------------------------- 3 files changed, 64 insertions(+), 55 deletions(-) diff --git a/src/config.xml b/src/config.xml index b07af96..4eeb81b 100644 --- a/src/config.xml +++ b/src/config.xml @@ -1,48 +1,52 @@ - + - z3950.loc.gov:7090 - z3950.loc.gov:7094 + bagel.indexdata.dk + 240 + 180 - 500000 - 500 + 1000000 + 1000 - - 200000 - 31 - 20 + + 2000000 + 50 + 100 - 240 - 180 + + - 2 + 0 localhost:9999 + localhost:9998 + 300 + 180 50000 60 10 - 300 - 180 - + + + - 0 + 2 - 500 - client-apdu server-apdu + 50 + client-apdu server-apdu diff --git a/src/yaz-pdu-assoc.cpp b/src/yaz-pdu-assoc.cpp index aa149d6..6ee18f6 100644 --- a/src/yaz-pdu-assoc.cpp +++ b/src/yaz-pdu-assoc.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2003, Index Data. * See the file LICENSE for details. * - * $Id: yaz-pdu-assoc.cpp,v 1.35 2003-10-20 18:31:44 adam Exp $ + * $Id: yaz-pdu-assoc.cpp,v 1.36 2003-10-23 08:46:55 adam Exp $ */ #include @@ -20,6 +20,7 @@ void Yaz_PDU_Assoc::init(IYazSocketObservable *socketObservable) m_socketObservable = socketObservable; m_PDU_Observer = 0; m_queue_out = 0; + m_queue_in = 0; m_input_buf = 0; m_input_len = 0; m_children = 0; @@ -208,8 +209,15 @@ void Yaz_PDU_Assoc::socketNotify(int event) if (!m_PDU_Observer) return; - +#if 0 + PDU_Queue **pq = &m_queue_in; + while (*pq) + pq = &(*pq)->m_next; + + *pq = new PDU_Queue(m_input_buf, res); +#else m_PDU_Observer->recv_PDU(m_input_buf, res); +#endif if (destroyed) // it really was destroyed, return now. return; m_destroyed = 0; diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 996f258..7c80f99 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2003, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy.cpp,v 1.63 2003-10-20 18:31:44 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.64 2003-10-23 08:46:55 adam Exp $ */ #include @@ -355,9 +355,8 @@ Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu) !strcmp(m_proxyTarget, c->get_hostname())) { // found it in cache - yaz_log (LOG_LOG, "%sREUSE %d %d %s", - m_session_str, - c->m_seqno, parent->m_seqno, c->get_hostname()); + yaz_log (LOG_LOG, "%sREUSE %s", + m_session_str, c->get_hostname()); c->m_seqno = parent->m_seqno; assert(c->m_server == 0); @@ -665,7 +664,6 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu) if (apdu->which == Z_APDU_presentRequest) { Z_PresentRequest *pr = apdu->u.presentRequest; - Z_NamePlusRecordList *npr; int toget = *pr->numberOfRecordsRequested; int start = *pr->resultSetStartPoint; @@ -684,6 +682,7 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu) send_to_client(new_apdu); return 0; } +#if 0 if (!strcmp(m_client->m_last_resultSetId, pr->resultSetId)) { if (start+toget-1 > m_client->m_last_resultCount) @@ -717,6 +716,7 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu) return 0; } } +#endif } if (apdu->which != Z_APDU_searchRequest) @@ -1010,37 +1010,34 @@ Z_APDU *Yaz_Proxy::handle_syntax_validation(Z_APDU *apdu) if (apdu->which == Z_APDU_searchRequest) { Z_SearchRequest *sr = apdu->u.searchRequest; - if (*sr->smallSetUpperBound > 0 || *sr->mediumSetPresentNumber > 0) + int err = 0; + char *addinfo = 0; + Yaz_ProxyConfig *cfg = check_reconfigure(); + + if (cfg) + err = cfg->check_syntax(odr_encode(), + m_default_target, + sr->preferredRecordSyntax, + &addinfo); + if (err == -1) { - int err = 0; - char *addinfo = 0; - Yaz_ProxyConfig *cfg = check_reconfigure(); - - if (cfg) - err = cfg->check_syntax(odr_encode(), - m_default_target, - sr->preferredRecordSyntax, - &addinfo); - if (err == -1) - { - sr->preferredRecordSyntax = - yaz_oidval_to_z3950oid(odr_decode(), CLASS_RECSYN, - VAL_USMARC); - m_marcxml_flag = 1; - } - else if (err) - { - Z_APDU *new_apdu = create_Z_PDU(Z_APDU_searchResponse); - - new_apdu->u.searchResponse->referenceId = sr->referenceId; - new_apdu->u.searchResponse->records = - create_nonSurrogateDiagnostics(odr_encode(), err, addinfo); - *new_apdu->u.searchResponse->searchStatus = 0; - - send_to_client(new_apdu); - - return 0; - } + sr->preferredRecordSyntax = + yaz_oidval_to_z3950oid(odr_decode(), CLASS_RECSYN, + VAL_USMARC); + m_marcxml_flag = 1; + } + else if (err) + { + Z_APDU *new_apdu = create_Z_PDU(Z_APDU_searchResponse); + + new_apdu->u.searchResponse->referenceId = sr->referenceId; + new_apdu->u.searchResponse->records = + create_nonSurrogateDiagnostics(odr_encode(), err, addinfo); + *new_apdu->u.searchResponse->searchStatus = 0; + + send_to_client(new_apdu); + + return 0; } } else if (apdu->which == Z_APDU_presentRequest) -- 1.7.10.4