Skip to content

Commit ba2d0d8

Browse files
authored
Merge pull request #160 from tfreitasleal/master
Update Wisej package to 1.5.4
2 parents 101b184 + 5081fc1 commit ba2d0d8

File tree

7 files changed

+68
-8
lines changed

7 files changed

+68
-8
lines changed

Source/Codisa.InterwayDocs.WisejWeb/Codisa.InterwayDocs.WisejWeb.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,11 @@
383383
<Reference Include="System.Windows.Forms" />
384384
<Reference Include="System.Xml" />
385385
<Reference Include="Wisej.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=17bef35e11b84171, processorArchitecture=MSIL">
386-
<HintPath>..\..\Dependencies\packages\Wisej.1.4.95\lib\net45\Wisej.Core.dll</HintPath>
386+
<HintPath>..\..\Dependencies\packages\Wisej.1.5.4\lib\net45\Wisej.Core.dll</HintPath>
387387
<Private>True</Private>
388388
</Reference>
389389
<Reference Include="Wisej.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=17bef35e11b84171, processorArchitecture=MSIL">
390-
<HintPath>..\..\Dependencies\packages\Wisej.1.4.95\lib\net45\Wisej.Web.dll</HintPath>
390+
<HintPath>..\..\Dependencies\packages\Wisej.1.5.4\lib\net45\Wisej.Web.dll</HintPath>
391391
<Private>True</Private>
392392
</Reference>
393393
</ItemGroup>

Source/Codisa.InterwayDocs.WisejWeb/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
<package id="NLog.Schema" version="4.5.6" targetFramework="net45" />
1313
<package id="NPOI" version="2.3.0" targetFramework="net45" />
1414
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
15-
<package id="Wisej" version="1.4.95" targetFramework="net45" />
15+
<package id="Wisej" version="1.5.4" targetFramework="net45" />
1616
</packages>

Source/InterwayDocs.Chrome/InterwayDocs.Chrome.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@
9898
<Reference Include="System.Web" />
9999
<Reference Include="System.Windows.Forms" />
100100
<Reference Include="Wisej.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=17bef35e11b84171, processorArchitecture=MSIL">
101-
<HintPath>..\..\Dependencies\packages\Wisej.1.4.95\lib\net45\Wisej.Core.dll</HintPath>
101+
<HintPath>..\..\Dependencies\packages\Wisej.1.5.4\lib\net45\Wisej.Core.dll</HintPath>
102102
<Private>True</Private>
103103
</Reference>
104104
<Reference Include="Wisej.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=17bef35e11b84171, processorArchitecture=MSIL">
105-
<HintPath>..\..\Dependencies\packages\Wisej.1.4.95\lib\net45\Wisej.Web.dll</HintPath>
105+
<HintPath>..\..\Dependencies\packages\Wisej.1.5.4\lib\net45\Wisej.Web.dll</HintPath>
106106
<Private>True</Private>
107107
</Reference>
108108
</ItemGroup>

Source/InterwayDocs.Chrome/Owin/WisejHost.cs

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
///////////////////////////////////////////////////////////////////////////////
1919

2020
using System;
21+
using System.Diagnostics;
2122
using System.Net;
2223
using System.Net.Sockets;
2324
using System.Reflection;
@@ -112,6 +113,9 @@ private static string GetDebugDirectory()
112113
/// <param name="immediate"></param>
113114
public void Stop(bool immediate)
114115
{
116+
Trace.TraceInformation("Stopping Wisej.Host: Domain={0}, Port={1}, Reason={2}", this.Domain, this.Port,
117+
HostingEnvironment.ShutdownReason);
118+
115119
try
116120
{
117121
HostingEnvironment.UnregisterObject(this);
@@ -158,6 +162,9 @@ public void Start(string domain, int port)
158162
this.Domain = domain;
159163
this.Url = "http://" + domain + ":" + port;
160164

165+
Trace.TraceInformation("Starting Wisej.Host: Domain={0}, Port={1}, Reason={2}", this.Domain, this.Port,
166+
HostingEnvironment.ShutdownReason);
167+
161168
// register with the .NET hosting system.
162169
HostingEnvironment.RegisterObject(this);
163170

Source/InterwayDocs.Chrome/Owin/WisejMiddleware.cs

+9-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ namespace Wisej.HostService.Owin
3939
/// </summary>
4040
internal class WisejMiddleware : OwinMiddleware
4141
{
42+
// reusable Wisej HttpHandler.
43+
private Wisej.Core.HttpHandler _httpHandler;
44+
4245
/// <summary>
4346
/// Process all requests.
4447
/// </summary>
4548
/// <param name="next"></param>
4649
public WisejMiddleware(OwinMiddleware next) : base(next)
4750
{
51+
this._httpHandler = new Wisej.Core.HttpHandler();
52+
if (!this._httpHandler.IsReusable)
53+
this._httpHandler = null;
4854
}
4955

5056
/// <summary>
@@ -99,7 +105,7 @@ Task ProcessSubApplication(IOwinContext context)
99105
}
100106
}
101107

102-
return this.Next.Invoke(context);
108+
return ProcessAspNetRequest(context);
103109
}
104110

105111
/// <summary>
@@ -120,7 +126,8 @@ Task ProcessWisejRequest(IOwinContext context)
120126

121127
// process the wisej http request and return the async task
122128
// pegged to the async wisej handler EndProcessRequest.
123-
var handler = new Wisej.Core.HttpHandler();
129+
var handler = this._httpHandler ?? new Wisej.Core.HttpHandler();
130+
124131
var async = handler.BeginProcessRequest(
125132
httpContext,
126133
r =>

Source/InterwayDocs.Chrome/Owin/WisejWebSocketContext.cs

+46
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using System.Collections.Generic;
2323
using System.Collections.Specialized;
2424
using System.Net.WebSockets;
25+
using System.Security.Principal;
2526
using System.Web;
2627
using System.Web.WebSockets;
2728

@@ -40,6 +41,36 @@ public WisejWebSocketContext(IDictionary<string, object> environment)
4041
this.webSocketContext = (WebSocketContext) environment["System.Net.WebSockets.WebSocketContext"];
4142
}
4243

44+
public override IPrincipal User
45+
{
46+
get { return this.context.User; }
47+
}
48+
49+
public override WindowsIdentity LogonUserIdentity
50+
{
51+
get { return this.request.LogonUserIdentity; }
52+
}
53+
54+
public override bool IsAuthenticated
55+
{
56+
get { return this.request.IsAuthenticated; }
57+
}
58+
59+
public override bool IsLocal
60+
{
61+
get { return this.request.IsLocal; }
62+
}
63+
64+
public override bool IsSecureConnection
65+
{
66+
get { return this.request.IsSecureConnection; }
67+
}
68+
69+
public override bool IsDebuggingEnabled
70+
{
71+
get { return this.context.IsDebuggingEnabled; }
72+
}
73+
4374
public override Uri RequestUri
4475
{
4576
get { return this.request.Url; }
@@ -67,6 +98,21 @@ public override bool IsClientConnected
6798
get { return this.WebSocket.State == WebSocketState.Open; }
6899
}
69100

101+
public override NameValueCollection ServerVariables
102+
{
103+
get { return this.request.ServerVariables; }
104+
}
105+
106+
public override HttpClientCertificate ClientCertificate
107+
{
108+
get { return this.request.ClientCertificate; }
109+
}
110+
111+
public override HttpApplicationStateBase Application
112+
{
113+
get { return new HttpApplicationStateWrapper(this.context.Application); }
114+
}
115+
70116
public override HttpServerUtilityBase Server
71117
{
72118
get { return new HttpServerUtilityWrapper(this.context.Server); }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Wisej" version="1.4.95" targetFramework="net452" />
3+
<package id="Wisej" version="1.5.4" targetFramework="net452" />
44
</packages>

0 commit comments

Comments
 (0)