From 2a31f5402506c5a0db02bb808ebe262bebc3743a Mon Sep 17 00:00:00 2001 From: James Willcox Date: Fri, 13 Jan 2006 23:07:10 +0000 Subject: [PATCH] 2006-01-13 James Willcox * src/ServiceLocator.cs (OnServiceResolved): don't fire of a 'Found' event if we already have it. svn path=/trunk/daap-sharp/; revision=55560 --- ChangeLog | 5 +++++ sample/UpdateTest.cs | 1 + src/ServiceLocator.cs | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6ed5550..fea1c21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-01-13 James Willcox + + * src/ServiceLocator.cs (OnServiceResolved): don't fire of a 'Found' + event if we already have it. + 2006-01-09 Aaron Bockover * src/ContentWriter.cs: diff --git a/sample/UpdateTest.cs b/sample/UpdateTest.cs index ebe9228..c88dc05 100644 --- a/sample/UpdateTest.cs +++ b/sample/UpdateTest.cs @@ -31,6 +31,7 @@ namespace DAAP.Tools { ServiceLocator locator = new ServiceLocator (); locator.Found += OnServiceFound; locator.Removed += OnServiceRemoved; + locator.Start (); } else { string host = args[0]; diff --git a/src/ServiceLocator.cs b/src/ServiceLocator.cs index 99c2412..b68ec9c 100644 --- a/src/ServiceLocator.cs +++ b/src/ServiceLocator.cs @@ -134,6 +134,11 @@ namespace DAAP { (o as ServiceResolver).Dispose (); string name = args.Service.Name; + + if (services[args.Service.Name] != null) { + return; // we already have it somehow + } + bool pwRequired = false; // iTunes tacks this on to indicate a passsword protected share. Ugh.