Ensure sessions with different auth IDs are not shared.
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 13 Oct 2008 14:02:11 +0000 (16:02 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 13 Oct 2008 14:02:11 +0000 (16:02 +0200)
This patch re-establishes the check for non-ZOOM code which ensure
that Z39.50 sessions with different authentication parameters are not
shared (reused).

src/connection.c
src/connection.h

index cdbe4da..b9964be 100644 (file)
@@ -71,7 +71,6 @@ struct connection {
     struct client *client;
     char *ibuf;
     int ibufsize;
-    char *authentication; // Empty string or authentication string if set
     char *zproxy;
     enum {
         Conn_Resolving,
@@ -181,7 +180,6 @@ static struct connection *connection_create(struct client *cl)
     new->next = new->host->connections;
     new->host->connections = new;
     new->client = cl;
-    new->authentication = "";
     new->zproxy = 0;
     client_set_connection(cl, new);
     new->link = 0;
@@ -426,11 +424,6 @@ const char *connection_get_url(struct connection *co)
     return client_get_url(co->client);
 }
 
-void connection_set_authentication(struct connection *co, char *auth)
-{
-    co->authentication = auth;
-}
-
 // Ensure that client has a connection associated
 int client_prep_connection(struct client *cl)
 {
@@ -454,9 +447,9 @@ int client_prep_connection(struct client *cl)
         for (co = host->connections; co; co = co->next)
             if (connection_is_idle(co) &&
                 (!co->client || client_get_session(co->client) != se) &&
-                !strcmp(co->authentication,
-                    session_setting_oneval(client_get_database(cl),
-                    PZ_AUTHENTICATION)))
+                !strcmp(ZOOM_connection_option_get(co->link, "user"),
+                        session_setting_oneval(client_get_database(cl),
+                                               PZ_AUTHENTICATION)))
             {
                 if (zproxy == 0 && co->zproxy == 0)
                     break;
index 13fdd14..e208fca 100644 (file)
@@ -35,7 +35,6 @@ struct session;
 
 void connection_destroy(struct connection *co);
 void connect_resolver_host(struct host *host);
-void connection_set_authentication(struct connection *co, char *auth);
 int connection_connect(struct connection *con);
 struct connection *connection_get_available(struct connection *con_list,
                                             struct session *se);