diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-06 08:53:54 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-06 08:55:18 -0700 |
commit | 85e4a62928a3fe89db316a082116ca6a81c2b7c4 (patch) | |
tree | feeea66c3f06557fb38cfeb5e7ac41443586f701 /samples/OpenIdOfflineProvider/HttpHost.cs | |
parent | 696671219537f333f2a4831588ccfed3161d59bd (diff) | |
download | DotNetOpenAuth-85e4a62928a3fe89db316a082116ca6a81c2b7c4.zip DotNetOpenAuth-85e4a62928a3fe89db316a082116ca6a81c2b7c4.tar.gz DotNetOpenAuth-85e4a62928a3fe89db316a082116ca6a81c2b7c4.tar.bz2 |
Fixed bug where offline OP would stop listening to connections.
Diffstat (limited to 'samples/OpenIdOfflineProvider/HttpHost.cs')
-rw-r--r-- | samples/OpenIdOfflineProvider/HttpHost.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/samples/OpenIdOfflineProvider/HttpHost.cs b/samples/OpenIdOfflineProvider/HttpHost.cs index 390275a..a2558f4 100644 --- a/samples/OpenIdOfflineProvider/HttpHost.cs +++ b/samples/OpenIdOfflineProvider/HttpHost.cs @@ -121,14 +121,19 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider { private void ProcessRequests() { Contract.Requires(this.listener != null); - try { - while (true) { + while (true) { + try { HttpListenerContext context = this.listener.GetContext(); this.handler(context); + } catch (HttpListenerException ex) { + if (this.listener.IsListening) { + App.Logger.Error("Unexpected exception.", ex); + } else { + // the listener is probably being shut down + App.Logger.Warn("HTTP listener is closing down.", ex); + break; + } } - } catch (HttpListenerException ex) { - // the listener is probably being shut down - App.Logger.Warn("HTTP listener is closing down.", ex); } } } |