From 4ed65f334f903782679e7590f92374d7c33ae772 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 8 Aug 2018 00:39:21 +0000 Subject: [PATCH 1/3] Add renovate.json --- renovate.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..f45d8f1 --- /dev/null +++ b/renovate.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "config:base" + ] +} From 5f197545bb68dbac05d73fa2d87f274a4b300d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20V=C3=A1zquez=20=28Dagger=29?= Date: Wed, 3 Oct 2018 14:28:37 +0200 Subject: [PATCH 2/3] Made the listeners disposable --- uhttpsharp/Listeners/IHttpListener.cs | 5 +++-- .../{SslListenerDecoerator.cs => SslListenerDecorator.cs} | 5 +++++ uhttpsharp/Listeners/TcpListenerAdapter.cs | 5 +++++ uhttpsharp/uhttpsharp.csproj | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) rename uhttpsharp/Listeners/{SslListenerDecoerator.cs => SslListenerDecorator.cs} (89%) diff --git a/uhttpsharp/Listeners/IHttpListener.cs b/uhttpsharp/Listeners/IHttpListener.cs index 6503765..687efc2 100644 --- a/uhttpsharp/Listeners/IHttpListener.cs +++ b/uhttpsharp/Listeners/IHttpListener.cs @@ -1,9 +1,10 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; using uhttpsharp.Clients; namespace uhttpsharp.Listeners { - public interface IHttpListener + public interface IHttpListener : IDisposable { Task GetClient(); diff --git a/uhttpsharp/Listeners/SslListenerDecoerator.cs b/uhttpsharp/Listeners/SslListenerDecorator.cs similarity index 89% rename from uhttpsharp/Listeners/SslListenerDecoerator.cs rename to uhttpsharp/Listeners/SslListenerDecorator.cs index 8da27f9..4d1986b 100644 --- a/uhttpsharp/Listeners/SslListenerDecoerator.cs +++ b/uhttpsharp/Listeners/SslListenerDecorator.cs @@ -18,6 +18,11 @@ public ListenerSslDecorator(IHttpListener child, X509Certificate certificate) public async Task GetClient() { return new ClientSslDecorator(await _child.GetClient().ConfigureAwait(false), _certificate); + } + + public void Dispose() + { + _child.Dispose(); } } } \ No newline at end of file diff --git a/uhttpsharp/Listeners/TcpListenerAdapter.cs b/uhttpsharp/Listeners/TcpListenerAdapter.cs index db68923..ebc6980 100644 --- a/uhttpsharp/Listeners/TcpListenerAdapter.cs +++ b/uhttpsharp/Listeners/TcpListenerAdapter.cs @@ -17,5 +17,10 @@ public async Task GetClient() { return new TcpClientAdapter(await _listener.AcceptTcpClientAsync().ConfigureAwait(false)); } + + public void Dispose() + { + _listener.Stop(); + } } } \ No newline at end of file diff --git a/uhttpsharp/uhttpsharp.csproj b/uhttpsharp/uhttpsharp.csproj index 404dd0d..e102ab3 100644 --- a/uhttpsharp/uhttpsharp.csproj +++ b/uhttpsharp/uhttpsharp.csproj @@ -101,7 +101,7 @@ - + From 524733aa8d4fe2f8229eadd022893ef01fb9b597 Mon Sep 17 00:00:00 2001 From: Jannek Hisleiter Date: Tue, 23 Apr 2019 21:05:51 +0200 Subject: [PATCH 3/3] fix parameter name mix-up in HttpResponse ("keepAliveConnection" vs "closeConnection") --- uhttpsharp/HttpResponse.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uhttpsharp/HttpResponse.cs b/uhttpsharp/HttpResponse.cs index 2afdd59..ea12b1b 100644 --- a/uhttpsharp/HttpResponse.cs +++ b/uhttpsharp/HttpResponse.cs @@ -160,18 +160,18 @@ public sealed class HttpResponse : IHttpResponse private readonly IHttpHeaders _headers; private readonly HttpResponseCode _responseCode; - public HttpResponse(HttpResponseCode code, string content, bool closeConnection) - : this(code, "text/html; charset=utf-8", StringToStream(content), closeConnection) + public HttpResponse(HttpResponseCode code, string content, bool keepAliveConnection) + : this(code, "text/html; charset=utf-8", StringToStream(content), keepAliveConnection) { } - public HttpResponse(HttpResponseCode code, string content, IEnumerable> headers, bool closeConnection) - : this(code, "text/html; charset=utf-8", StringToStream(content), closeConnection,headers) + public HttpResponse(HttpResponseCode code, string content, IEnumerable> headers, bool keepAliveConnection) + : this(code, "text/html; charset=utf-8", StringToStream(content), keepAliveConnection, headers) { } - public HttpResponse(string contentType, Stream contentStream, bool closeConnection) - : this(HttpResponseCode.Ok, contentType, contentStream, closeConnection) + public HttpResponse(string contentType, Stream contentStream, bool keepAliveConnection) + : this(HttpResponseCode.Ok, contentType, contentStream, keepAliveConnection) { }