From 79a9e68c4b373be7384552c58110f9ae28656b49 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 8 Oct 2003 09:49:05 +0000 Subject: [PATCH] Prevent multiplexing for cookie sessions --- src/config.xml | 2 +- src/yaz-proxy.cpp | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/config.xml b/src/config.xml index d8d5045..8f197be 100644 --- a/src/config.xml +++ b/src/config.xml @@ -35,5 +35,5 @@ - 100 + 500 diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index e7c1ad2..96054a3 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.52 2003-10-08 09:32:49 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.53 2003-10-08 09:49:05 adam Exp $ */ #include @@ -176,7 +176,7 @@ const char *Yaz_Proxy::load_balance(const char **url) const char *ret = 0; for (i = 0; url[i]; i++) { - yaz_log(LOG_LOG, "%s zurl=%s use=%d", + yaz_log(LOG_DEBUG, "%s zurl=%s use=%d", m_session_str, url[i], zurl_in_use[i]); if (min > zurl_in_use[i]) { @@ -223,7 +223,13 @@ Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu) yaz_log(LOG_LOG, "%s No default target", m_session_str); return 0; } - m_proxyTarget = (char*) xstrdup(load_balance(url)); + // we don't handle multiplexing for cookie session, so we just + // pick the first one in this case (anonymous users will be able + // to use any backend) + if (cookie && *cookie) + m_proxyTarget = (char*) xstrdup(url[0]); + else + m_proxyTarget = (char*) xstrdup(load_balance(url)); } if (cookie && *cookie) { @@ -331,10 +337,10 @@ Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu) int min_seq = -1; int no_of_clients = 0; if (parent->m_clientPool) - yaz_log (LOG_LOG, "Existing sessions"); + yaz_log (LOG_DEBUG, "Existing sessions"); for (c = parent->m_clientPool; c; c = c->m_next) { - yaz_log (LOG_LOG, " Session %-3d wait=%d %s cookie=%s", c->m_seqno, + yaz_log (LOG_DEBUG, " Session %-3d wait=%d %s cookie=%s", c->m_seqno, c->m_waiting, c->get_hostname(), c->m_cookie ? c->m_cookie : ""); no_of_clients++; -- 1.7.10.4