Fix a few for ListenerAsyncResult.cs

This commit is contained in:
sta 2014-04-06 15:47:07 +09:00
parent 0ba5d61f4a
commit e852787da5

View File

@ -8,7 +8,7 @@
* The MIT License
*
* Copyright (c) 2005 Ximian, Inc. (http://www.ximian.com)
* Copyright (c) 2012-2013 sta.blockhead
* Copyright (c) 2012-2014 sta.blockhead
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -33,7 +33,7 @@
#region Authors
/*
* Authors:
* Gonzalo Paniagua Javier <gonzalo@ximian.com>
* - Gonzalo Paniagua Javier <gonzalo@ximian.com>
*/
#endregion
@ -124,7 +124,7 @@ namespace WebSocketSharp.Net
internal void Complete (Exception exception)
{
_exception = InGet && (exception is ObjectDisposedException)
? new HttpListenerException (500, "Listener closed")
? new HttpListenerException (500, "Listener closed.")
: exception;
lock (_sync) {
@ -155,22 +155,20 @@ namespace WebSocketSharp.Net
var header = context.Request.Headers ["Authorization"];
if (scheme == AuthenticationSchemes.Basic &&
(header == null ||
!header.StartsWith ("basic", StringComparison.OrdinalIgnoreCase))) {
(header == null || !header.StartsWith ("basic", StringComparison.OrdinalIgnoreCase))) {
context.Response.CloseWithAuthChallenge (
HttpUtility.CreateBasicAuthChallenge (listener.Realm));
listener.BeginGetContext (this);
listener.BeginGetContext (this);
return;
}
if (scheme == AuthenticationSchemes.Digest &&
(header == null ||
!header.StartsWith ("digest", StringComparison.OrdinalIgnoreCase))) {
(header == null || !header.StartsWith ("digest", StringComparison.OrdinalIgnoreCase))) {
context.Response.CloseWithAuthChallenge (
HttpUtility.CreateDigestAuthChallenge (listener.Realm));
listener.BeginGetContext (this);
listener.BeginGetContext (this);
return;
}