From: Adam Dickmeiss Date: Wed, 21 May 2008 11:29:43 +0000 (+0200) Subject: Bump version to 1.3.3.1 X-Git-Tag: v1.3.3.1 X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=commitdiff_plain;h=5ace60a2d363137c0e55b78611be2aa00e1d0e2d;ds=sidebyside Bump version to 1.3.3.1 --- diff --git a/NEWS b/NEWS index 9a0abf1..0eace3e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +--- 1.3.3.1 2008/05/21 + +Z39.50 authentication user is no longer set to client-IP for SRU. + --- 1.3.3 2008/03/20 Added support for limiting the number of sockets (connections) to diff --git a/configure.ac b/configure.ac index eaa499b..9944564 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl This file is part of YAZ proxy dnl See the file LICENSE for details. AC_PREREQ(2.60) -AC_INIT([yazproxy],[1.3.3],[adam@indexdata.dk]) +AC_INIT([yazproxy],[1.3.3.1],[adam@indexdata.dk]) AC_CONFIG_SRCDIR(configure.ac) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([1.9]) diff --git a/include/yazproxy/module.h b/include/yazproxy/module.h index 70ff1a3..1817954 100644 --- a/include/yazproxy/module.h +++ b/include/yazproxy/module.h @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA struct Yaz_ProxyModule_entry { int int_version; - char *module_name; - char *module_description; + const char *module_name; + const char *module_description; void *fl; }; diff --git a/src/mod_helsinki.cpp b/src/mod_helsinki.cpp index 23c3d40..150e9ab 100644 --- a/src/mod_helsinki.cpp +++ b/src/mod_helsinki.cpp @@ -151,7 +151,7 @@ int my_authenticate(void *user_handle, // 192.168.0.100 // 192.168.0.1-192.168.0.200 int status = YAZPROXY_RET_PERM; - if (ip_file && peer_IP) + if (*ip_file && peer_IP) { yaz_log(YLOG_DEBUG, "Authentication: checking ip address"); diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 314c71d..f647343 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -1173,7 +1173,7 @@ int Yaz_Proxy::send_srw_response(Z_SRW_PDU *srw_pdu, int http_code /* = 200 */) static Z_SOAP_Handler soap_handlers[2] = { #if YAZ_HAVE_XSLT - {"http://www.loc.gov/zing/srw/", 0, + { (char*) "http://www.loc.gov/zing/srw/", 0, (Z_SOAP_fun) yaz_srw_codec}, #endif {0, 0, 0} @@ -1231,6 +1231,35 @@ int Yaz_Proxy::z_to_srw_diag(ODR o, Z_SRW_searchRetrieveResponse *srw_res, return 0; } +static void yazproxy_encode_sru_surrogate(ODR o, Z_SRW_record *record, int pos, + int code, const char *details) +{ + const char *message = yaz_diag_srw_str(code); + int len = 200; + if (message) + len += strlen(message); + if (details) + len += strlen(details); + + record->recordData_buf = (char *) odr_malloc(o, len); + + sprintf(record->recordData_buf, "\n" + " info:srw/diagnostic/1/%d\n", code); + if (details) + sprintf(record->recordData_buf + strlen(record->recordData_buf), + "
%s
\n", details); + if (message) + sprintf(record->recordData_buf + strlen(record->recordData_buf), + " %s\n", message); + sprintf(record->recordData_buf + strlen(record->recordData_buf), + "
\n"); + record->recordData_len = strlen(record->recordData_buf); + record->recordPosition = odr_intdup(o, pos); + record->recordSchema = odr_strdup(o, "info:srw/schema/1/diagnostics-v1.1"); +} + + int Yaz_Proxy::send_to_srw_client_ok(int hits, Z_Records *records, int start) { ODR o = odr_encode(); @@ -1250,11 +1279,10 @@ int Yaz_Proxy::send_to_srw_client_ok(int hits, Z_Records *records, int start) Z_NamePlusRecord *npr = records->u.databaseOrSurDiagnostics->records[i]; if (npr->which != Z_NamePlusRecord_databaseRecord) { - srw_res->records[i].recordSchema = "diagnostic"; - srw_res->records[i].recordPacking = m_s2z_packing; - srw_res->records[i].recordData_buf = "67"; - srw_res->records[i].recordData_len = 2; - srw_res->records[i].recordPosition = odr_intdup(o, i+start); + yaz_log(YLOG_LOG, "Point 1"); + yazproxy_encode_sru_surrogate( + o, srw_res->records + i, i+start, + YAZ_SRW_RECORD_NOT_AVAILABLE_IN_THIS_SCHEMA, 0); continue; } Z_External *r = npr->u.databaseRecord; @@ -1271,11 +1299,10 @@ int Yaz_Proxy::send_to_srw_client_ok(int hits, Z_Records *records, int start) } else { - srw_res->records[i].recordSchema = "diagnostic"; - srw_res->records[i].recordPacking = m_s2z_packing; - srw_res->records[i].recordData_buf = "67"; - srw_res->records[i].recordData_len = 2; - srw_res->records[i].recordPosition = odr_intdup(o, i+start); + yaz_log(YLOG_LOG, "Point 2"); + yazproxy_encode_sru_surrogate( + o, srw_res->records + i, i+start, + YAZ_SRW_RECORD_NOT_AVAILABLE_IN_THIS_SCHEMA, 0); } } } @@ -1320,7 +1347,8 @@ int Yaz_Proxy::send_srw_explain_response(Z_SRW_diagnostic *diagnostics, er->record.recordData_buf = b; er->record.recordData_len = len; er->record.recordPacking = m_s2z_packing; - er->record.recordSchema = "http://explain.z3950.org/dtd/2.0/"; + er->record.recordSchema = odr_strdup(odr_encode(), + "http://explain.z3950.org/dtd/2.0/"); er->diagnostics = diagnostics; er->num_diagnostics = num_diagnostics;