From 4e07eba7595a483171647da92f2e942e53278959 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 22 Nov 2004 07:31:44 +0000 Subject: [PATCH] Fix the no-session problem with iTunes 4.7 by counting unique ip addresses rather than sessions in the online user count --- src/configfile.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index 16e7345d..ec780e25 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -708,19 +708,18 @@ int config_get_session_count(void) { } pcurrent=scan_status.next; - while(pcurrent) { - if(pcurrent->session != 0) { - /* check to see if there is another one before this one */ - pcheck=scan_status.next; - while(pcheck != pcurrent) { - if(pcheck->session == pcurrent->session) - break; - pcheck=pcheck->next; - } - if(pcheck == pcurrent) - count++; + while(pcurrent) { + pcheck=scan_status.next; + while(pcheck != pcurrent) { + if(strcmp(pcheck->host,pcurrent->host) == 0) + break; + pcheck=pcheck->next; } + + if(pcheck == pcurrent) + count++; + pcurrent=pcurrent->next; }