diff --git a/src/Mono.WebServer.Apache/main.cs b/src/Mono.WebServer.Apache/main.cs index 9c2082b..5b596c6 100644 --- a/src/Mono.WebServer.Apache/main.cs +++ b/src/Mono.WebServer.Apache/main.cs @@ -178,7 +178,7 @@ namespace Mono.WebServer.Apache { } try { - if (server.Start (!configurationManager.NonStop, (int)configurationManager.Backlog) == false) + if (!server.Start (!configurationManager.NonStop, (int)configurationManager.Backlog)) return 2; if (!configurationManager.NonStop) { diff --git a/src/Mono.WebServer.FastCgi/Server/IGenericServer.cs b/src/Mono.WebServer.FastCgi/Server/IGenericServer.cs index 61f65ee..4b3b96b 100644 --- a/src/Mono.WebServer.FastCgi/Server/IGenericServer.cs +++ b/src/Mono.WebServer.FastCgi/Server/IGenericServer.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -using System; using System.Collections.Generic; namespace Mono.WebServer.FastCgi diff --git a/src/Mono.WebServer.Fpm/ConfigurationManager.cs b/src/Mono.WebServer.Fpm/ConfigurationManager.cs index 39dd2e0..c4ecd52 100644 --- a/src/Mono.WebServer.Fpm/ConfigurationManager.cs +++ b/src/Mono.WebServer.Fpm/ConfigurationManager.cs @@ -35,7 +35,7 @@ namespace Mono.WebServer.Fpm { readonly BoolSetting stoppable = new BoolSetting ("stoppable", Descriptions.Stoppable); readonly StringSetting configDir = new StringSetting ("config-dir", "Directory containing the configuration files."); - readonly StringSetting fastCgiCommand = new StringSetting ("fastcgi-command", "Name (if in PATH) or full path of the fastcgi executable", defaultValue: "fastcgi-mono-server"); + readonly StringSetting fastCgiCommand = new StringSetting ("fastcgi-command", "Name (if in PATH) or full path of the fastcgi executable", defaultValue: "fastcgi-mono-server4"); #endregion #region Typesafe properties diff --git a/src/Mono.WebServer.Test/CompatArraySegmentTest.cs b/src/Mono.WebServer.Test/CompatArraySegmentTest.cs index c463d29..0953d79 100644 --- a/src/Mono.WebServer.Test/CompatArraySegmentTest.cs +++ b/src/Mono.WebServer.Test/CompatArraySegmentTest.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Mono.WebServer.FastCgi.Compatibility; using NUnit.Framework; diff --git a/src/Mono.WebServer.XSP/XSPWorker.cs b/src/Mono.WebServer.XSP/XSPWorker.cs index 2be241e..fdd43c6 100644 --- a/src/Mono.WebServer.XSP/XSPWorker.cs +++ b/src/Mono.WebServer.XSP/XSPWorker.cs @@ -230,7 +230,7 @@ namespace Mono.WebServer.XSP stream.Close (); if (stream != netStream) { netStream.Close (); - } else if (false == netStream.OwnsSocket) { + } else if (!netStream.OwnsSocket) { try { if (sock.Connected && !(sock.Poll (0, SelectMode.SelectRead) && sock.Available == 0)) sock.Shutdown (SocketShutdown.Both); diff --git a/src/Mono.WebServer.XSP/XSPWorkerRequest.cs b/src/Mono.WebServer.XSP/XSPWorkerRequest.cs index dce7f6f..e409630 100644 --- a/src/Mono.WebServer.XSP/XSPWorkerRequest.cs +++ b/src/Mono.WebServer.XSP/XSPWorkerRequest.cs @@ -441,7 +441,7 @@ namespace Mono.WebServer return null; var content_length = (string) headers ["Content-Length"]; - long length = -1; + long length; // If not empty parse, if correctly parsed validate if (!String.IsNullOrEmpty (content_length) @@ -450,7 +450,7 @@ namespace Mono.WebServer throw new InvalidOperationException ("Content-Length exceeds the maximum accepted size."); int input_data_length = inputLength - position; - if (length == -1 || length > input_data_length) + if (length < 0 || length > input_data_length) length = input_data_length; var result = new byte [length]; diff --git a/src/Mono.WebServer/ApplicationServer.cs b/src/Mono.WebServer/ApplicationServer.cs index 5353180..00afa19 100644 --- a/src/Mono.WebServer/ApplicationServer.cs +++ b/src/Mono.WebServer/ApplicationServer.cs @@ -462,10 +462,10 @@ namespace Mono.WebServer // The next line can throw (reusing and the client closed) Worker worker = webSource.CreateWorker (accepted, this); worker.SetReuseCount (reuses); - if (false == worker.IsAsync) - ThreadPool.QueueUserWorkItem (worker.Run); - else + if (worker.IsAsync) worker.Run (null); + else + ThreadPool.QueueUserWorkItem (worker.Run); } catch (Exception) { try { if (accepted != null) { diff --git a/src/Mono.WebServer/Log/Logger.cs b/src/Mono.WebServer/Log/Logger.cs index 108ba72..05cc418 100644 --- a/src/Mono.WebServer/Log/Logger.cs +++ b/src/Mono.WebServer/Log/Logger.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Threading; -using System.Diagnostics; namespace Mono.WebServer.Log { public static class Logger