From: Dennis Schafroth Date: Thu, 17 Jun 2010 15:19:34 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2 X-Git-Tag: v1.4.3~14 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=9a29dfe185cbcbec55a5ca0a3c491b03ff45222f;hp=0b98fc3f38dc8d6d789f0e0746d79e342ea05687;p=pazpar2-moved-to-github.git Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2 Conflicts: test/test_http_49.res Restore to new test result. --- diff --git a/src/connection.c b/src/connection.c index 19d0477..0d77a90 100644 --- a/src/connection.c +++ b/src/connection.c @@ -471,11 +471,17 @@ int client_prep_connection(struct client *cl, if (!co) { int max_connections = 0; + int reuse_connection = 0; const char *v = session_setting_oneval(client_get_database(cl), PZ_MAX_CONNECTIONS); if (v && *v) max_connections = atoi(v); - + + v = session_setting_oneval(client_get_database(cl), + PZ_REUSE_CONNECTIONS); + if (v && *v) + reuse_connections = atoi(v); + // See if someone else has an idle connection // We should look at timestamps here to select the longest-idle connection yaz_mutex_enter(host->mutex); @@ -484,25 +490,26 @@ int client_prep_connection(struct client *cl, int num_connections = 0; for (co = host->connections; co; co = co->next) num_connections++; - for (co = host->connections; co; co = co->next) - { - if (connection_is_idle(co) && - (!co->client || client_get_state(co->client) == Client_Idle) && - !strcmp(ZOOM_connection_option_get(co->link, "user"), - session_setting_oneval(client_get_database(cl), - PZ_AUTHENTICATION))) + if (reuse_connection) { + for (co = host->connections; reuse_connection && co; co = co->next) { - if (zproxy == 0 && co->zproxy == 0) - break; - if (zproxy && co->zproxy && !strcmp(zproxy, co->zproxy)) - break; + if (connection_is_idle(co) && + (!co->client || client_get_state(co->client) == Client_Idle) && + !strcmp(ZOOM_connection_option_get(co->link, "user"), + session_setting_oneval(client_get_database(cl), + PZ_AUTHENTICATION))) + { + if (zproxy == 0 && co->zproxy == 0) + break; + if (zproxy && co->zproxy && !strcmp(zproxy, co->zproxy)) + break; + } + } + if (co) + { + yaz_log(YLOG_LOG, "num_connections = %d (reusing)", num_connections); + break; } - } - if (co) - { - yaz_log(YLOG_LOG, "num_connections = %d (reusing)", - num_connections); - break; } if (max_connections <= 0 || num_connections < max_connections) { diff --git a/src/settings.h b/src/settings.h index 71fb326..fd12f7e 100644 --- a/src/settings.h +++ b/src/settings.h @@ -38,12 +38,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define PZ_SRU 15 #define PZ_SRU_VERSION 16 #define PZ_PQF_PREFIX 17 -#define PZ_SORT 18 +#define PZ_SORT 18 #define PZ_RECORDFILTER 19 #define PZ_PQF_STRFTIME 20 #define PZ_NEGOTIATION_CHARSET 21 -#define PZ_MAX_CONNECTIONS 22 -#define PZ_MAX_EOF 23 +#define PZ_MAX_CONNECTIONS 22 +#define PZ_REUSE_CONNECTIONS 23 +#define PZ_MAX_EOF 24 struct setting { diff --git a/test/run_pazpar2.sh b/test/run_pazpar2.sh index 28e81aa..0dadcb1 100755 --- a/test/run_pazpar2.sh +++ b/test/run_pazpar2.sh @@ -78,6 +78,9 @@ for f in `cat ${srcdir}/${URLS}`; do OUT2=${PREFIX}_${testno}.log DIFF=${PREFIX}_${testno}.dif rm -f $OUT2 $DIFF + if [ -n "$DEBUG" ] ; then + echo "test $testno: $f" + fi if test -n "${postfile}"; then eval $POST else @@ -102,6 +105,9 @@ for f in `cat ${srcdir}/${URLS}`; do testno=`expr $testno + 1` postfile= elif echo $f | grep '^[0-9]' >/dev/null; then + if [ -n "$DEBUG" ] ; then + echo "Sleeping $f" + fi sleep $f else if test -f $srcdir/$f; then diff --git a/test/test_http_46.res b/test/test_http_46.res index 7f14f96..6bfa568 100644 --- a/test/test_http_46.res +++ b/test/test_http_46.res @@ -1,2 +1,73 @@ - -OK71 \ No newline at end of file + + 01365nam a2200265 i 4504 + 73090924 //r82 + DLC + 19820524000000.0 + 760609s1974 nyua b 10110 eng + + 73090924 //r82 + + + DLC + DLC + DLC + + + RC71.3 + .W67 1971 + + + 616.07/575/02854 + + + Workshop on Computer Processing of Dynamic Images from an Anger Scintillation Camera, + Washington University, + 1971. + + + Computer processing of dynamic images from an Anger scintillation camera : + the proceedings of a workshop / + cosponsored by the Biomedical Computer Laboratory and the Nuclear Medicine Division, Department of Radiology, School of Medicine, Washington University, St. Louis, January 18-22, 1971 ; edited by Kenneth B. Larson, Jerome R. Cox, Jr. + + + New York : + Society of Nuclear Medicine, + [c1974] + + + xiv, p. : + ill. ; + 24 cm. + + + Includes bibliographical references and index. + + + Radioisotope scanning + Data processing + Congresses. + + + Scintillation cameras + Congresses. + + + Imaging systems in medicine + Data processing + Congresses. + + + Larson, Kenneth B. + + + Cox, Jerome R. + + + Washington University, St. Louis. + Biomedical Computer Laboratory. + + + Washington University, St. Louis. + Nuclear Medicine Division. + + diff --git a/test/test_http_47.res b/test/test_http_47.res index ab63fe6..7f14f96 100644 --- a/test/test_http_47.res +++ b/test/test_http_47.res @@ -1,2 +1,2 @@ -OK \ No newline at end of file +OK71 \ No newline at end of file diff --git a/test/test_http_48.res b/test/test_http_48.res index 43fcf8b..ab63fe6 100644 --- a/test/test_http_48.res +++ b/test/test_http_48.res @@ -1,26 +1,2 @@ - -OK -0 -1 -1 -0 -1 - - -The religious teachers of Greece -1972 -Adam, James -Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures -The religious teachers of Greece -1972 -Adam, James -Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures -Includes bibliographical references -XXXXXXXXXX -test-usersetting-2 data: - YYYYYYYYY -120000 -title the religious teachers of greece author adam james medium book - - +OK \ No newline at end of file diff --git a/test/test_http_49.res b/test/test_http_49.res index 6bfa568..43fcf8b 100644 --- a/test/test_http_49.res +++ b/test/test_http_49.res @@ -1,73 +1,26 @@ - - 01365nam a2200265 i 4504 - 73090924 //r82 - DLC - 19820524000000.0 - 760609s1974 nyua b 10110 eng - - 73090924 //r82 - - - DLC - DLC - DLC - - - RC71.3 - .W67 1971 - - - 616.07/575/02854 - - - Workshop on Computer Processing of Dynamic Images from an Anger Scintillation Camera, - Washington University, - 1971. - - - Computer processing of dynamic images from an Anger scintillation camera : - the proceedings of a workshop / - cosponsored by the Biomedical Computer Laboratory and the Nuclear Medicine Division, Department of Radiology, School of Medicine, Washington University, St. Louis, January 18-22, 1971 ; edited by Kenneth B. Larson, Jerome R. Cox, Jr. - - - New York : - Society of Nuclear Medicine, - [c1974] - - - xiv, p. : - ill. ; - 24 cm. - - - Includes bibliographical references and index. - - - Radioisotope scanning - Data processing - Congresses. - - - Scintillation cameras - Congresses. - - - Imaging systems in medicine - Data processing - Congresses. - - - Larson, Kenneth B. - - - Cox, Jerome R. - - - Washington University, St. Louis. - Biomedical Computer Laboratory. - - - Washington University, St. Louis. - Nuclear Medicine Division. - - + + +OK +0 +1 +1 +0 +1 + + +The religious teachers of Greece +1972 +Adam, James +Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures +The religious teachers of Greece +1972 +Adam, James +Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures +Includes bibliographical references +XXXXXXXXXX +test-usersetting-2 data: + YYYYYYYYY +120000 +title the religious teachers of greece author adam james medium book + + diff --git a/test/test_http_50.res b/test/test_http_50.res new file mode 100644 index 0000000..2b89580 --- /dev/null +++ b/test/test_http_50.res @@ -0,0 +1,25 @@ + + +OK +0 +1 +1 +0 +1 + + +Computer processing of dynamic images from an Anger scintillation camera +the proceedings of a workshop +1974 +Includes bibliographical references and index +Computer processing of dynamic images from an Anger scintillation camera +the proceedings of a workshop +1974 +Includes bibliographical references and index +XXXXXXXXXX +test-usersetting-2 data: + YYYYYYYYY +0 +title computer processing of dynamic images from an anger scintillation camera author medium book + + diff --git a/test/test_http_51.res b/test/test_http_51.res new file mode 100644 index 0000000..6bfa568 --- /dev/null +++ b/test/test_http_51.res @@ -0,0 +1,73 @@ + + 01365nam a2200265 i 4504 + 73090924 //r82 + DLC + 19820524000000.0 + 760609s1974 nyua b 10110 eng + + 73090924 //r82 + + + DLC + DLC + DLC + + + RC71.3 + .W67 1971 + + + 616.07/575/02854 + + + Workshop on Computer Processing of Dynamic Images from an Anger Scintillation Camera, + Washington University, + 1971. + + + Computer processing of dynamic images from an Anger scintillation camera : + the proceedings of a workshop / + cosponsored by the Biomedical Computer Laboratory and the Nuclear Medicine Division, Department of Radiology, School of Medicine, Washington University, St. Louis, January 18-22, 1971 ; edited by Kenneth B. Larson, Jerome R. Cox, Jr. + + + New York : + Society of Nuclear Medicine, + [c1974] + + + xiv, p. : + ill. ; + 24 cm. + + + Includes bibliographical references and index. + + + Radioisotope scanning + Data processing + Congresses. + + + Scintillation cameras + Congresses. + + + Imaging systems in medicine + Data processing + Congresses. + + + Larson, Kenneth B. + + + Cox, Jerome R. + + + Washington University, St. Louis. + Biomedical Computer Laboratory. + + + Washington University, St. Louis. + Nuclear Medicine Division. + + diff --git a/test/test_http_urls b/test/test_http_urls index a36d278..d1efce6 100644 --- a/test/test_http_urls +++ b/test/test_http_urls @@ -33,17 +33,25 @@ http://localhost:9763/search.pz2?session=4&command=search&query=computer http://localhost:9763/search.pz2?command=init http://localhost:9763/search.pz2?session=5&command=settings&pz:name%5Bz3950.indexdata.com%2Fmarc%5D=marc&pz:requestsyntax%5Bz3950.indexdata.com%2Fmarc%5D=usmarc&pz:nativesyntax%5Bz3950.indexdata.com%2Fmarc%5D=iso2709&pz:xslt%5Bz3950.indexdata.com%2Fmarc%5D=marc21%5Ftest.xsl&pz:recordfilter%5Bz3950.indexdata.com%2Fmarc%5D=date http://localhost:9763/search.pz2?session=5&command=search&query=computer&filter=pz%3Aid%3Dz3950.indexdata.com%2Fmarc -2 http://localhost:9763/search.pz2?session=5&command=show&block=1 +2 +http://localhost:9763/search.pz2?session=5&command=show&block=1 http://localhost:9763/search.pz2?session=5&command=search&query=computer&filter=pz%3Aid%3Dunknown http://localhost:9763/search.pz2?session=3&command=settings&pz:maxrecs%5Bz3950.indexdata.com%2Fgils%5D=8 http://localhost:9763/search.pz2?session=3&command=search&query=the http://localhost:9763/search.pz2?session=5&command=search&query=the&maxrecs=5&startrecs=2 -2 http://localhost:9763/search.pz2?session=3&command=show&block=1 +2 +http://localhost:9763/search.pz2?session=3&command=show&block=1 http://localhost:9763/search.pz2?session=5&command=show&block=1 http://localhost:9763/search.pz2?command=init&pz:elements%5Bz3950.indexdata.com%2Fmarc%5D=F -1 http://localhost:9763/search.pz2?session=6&command=search&query=louis +1 +http://localhost:9763/search.pz2?session=6&command=search&query=louis +1 http://localhost:9763/search.pz2?session=6&command=show&block=1 +http://localhost:9763/search.pz2?session=6&command=record&id=title+computer+processing+of+dynamic+images+from+an+anger+scintillation+camera+author+medium+book&offset=0 http://localhost:9763/search.pz2?command=init&pz:elements%5Bz3950.indexdata.com%2Fmarc%5D=F -1 http://localhost:9763/search.pz2?session=7&command=search&query=greece +http://localhost:9763/search.pz2?session=7&command=search&query=greece +1 http://localhost:9763/search.pz2?session=7&command=show&block=1 +1 +http://localhost:9763/search.pz2?session=6&command=show&block=1 http://localhost:9763/search.pz2?session=6&command=record&id=title+computer+processing+of+dynamic+images+from+an+anger+scintillation+camera+author+medium+book&offset=0