Author: jwilcox
Date: 2006-09-24 19:06:33 -0400 (Sun, 24 Sep 2006)
New Revision: 65874
Modified:
trunk/daap-sharp/ChangeLog
trunk/daap-sharp/src/Client.cs
trunk/daap-sharp/src/ContentFetcher.cs
Log:
2006-09-24 James Willcox <[EMAIL PROTECTED]>
* src/Client.cs: kill all connections to the server before logging out.
Modified: trunk/daap-sharp/ChangeLog
===================================================================
--- trunk/daap-sharp/ChangeLog 2006-09-24 21:52:34 UTC (rev 65873)
+++ trunk/daap-sharp/ChangeLog 2006-09-24 23:06:33 UTC (rev 65874)
@@ -1,3 +1,7 @@
+2006-09-24 James Willcox <[EMAIL PROTECTED]>
+
+ * src/Client.cs: kill all connections to the server before logging out.
+
2006-09-23 James Willcox <[EMAIL PROTECTED]>
* src/ContentFetcher.cs: correctly close the in-progress requests
Modified: trunk/daap-sharp/src/Client.cs
===================================================================
--- trunk/daap-sharp/src/Client.cs 2006-09-24 21:52:34 UTC (rev 65873)
+++ trunk/daap-sharp/src/Client.cs 2006-09-24 23:06:33 UTC (rev 65874)
@@ -147,13 +147,14 @@
public void Logout () {
try {
+ updateRunning = false;
+ fetcher.KillAll ();
fetcher.Fetch ("/logout");
} catch (WebException e) {
// some servers don't implement this, etc.
}
fetcher.SessionId = 0;
- updateRunning = false;
}
private void FetchDatabases () {
Modified: trunk/daap-sharp/src/ContentFetcher.cs
===================================================================
--- trunk/daap-sharp/src/ContentFetcher.cs 2006-09-24 21:52:34 UTC (rev
65873)
+++ trunk/daap-sharp/src/ContentFetcher.cs 2006-09-24 23:06:33 UTC (rev
65874)
@@ -59,18 +59,16 @@
}
public void Dispose () {
- try {
- lock (requests) {
- foreach (WebRequest request in requests) {
- request.Abort ();
- }
+ KillAll ();
+ }
+
+ public void KillAll () {
+ lock (requests) {
+ foreach (WebRequest request in requests) {
+ request.Abort ();
}
- } catch (Exception e) {
- Console.WriteLine (e);
- } finally {
- lock (requests) {
- requests.Clear ();
- }
+
+ requests.Clear ();
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches