Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions frameworks/genhttp-ioxide/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:11.0 AS build

# GenHTTP built from source: the branch of Kaliumhexacyanoferrat/GenHTTP#953
# (update-ioxide-0.20.396) rather than the 11.3.0 release. Pinned to one commit,
# because a build on cached layers would otherwise keep whichever it cloned first.
ARG GENHTTP_COMMIT=28b0cd107bb36321408a3a1f892f3bb45225e9d7
RUN git init -q /genhttp \
&& git -C /genhttp fetch -q --depth 1 https://github.com/Kaliumhexacyanoferrat/GenHTTP.git "$GENHTTP_COMMIT" \
&& git -C /genhttp checkout -q FETCH_HEAD

WORKDIR /src/app

COPY genhttp.csproj ./
Expand Down
2 changes: 2 additions & 0 deletions frameworks/genhttp-ioxide/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ private static LayoutBuilder AddStaticFiles(this LayoutBuilder app)

private static LayoutBuilder AddWebsocket(this LayoutBuilder app)
{
// Frames of up to 64 KiB, rather than the 16 KiB default
var websocket = Websocket.Imperative()
.DoNotAllocateFrameData()
.MaxFrameSize(64 * 1024)
.Handler(new EchoHandler());

return app.Add("ws", websocket);
Expand Down
4 changes: 2 additions & 2 deletions frameworks/genhttp-ioxide/Tests/EchoHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ private static async ValueTask<bool> HandleAsync(IWebsocketFrame frame, IImperat
return false;

case FrameType.Error:
if (frame.IsError(out var error) && error.ErrorType is not (FrameErrorType.Canceled or FrameErrorType.IncompleteForever))
if (frame.IsError(out var error) && error.CloseStatus is { } status)
{
await TryCloseAsync(connection, error.ErrorType == FrameErrorType.PayloadTooLarge ? (ushort)1009 : (ushort)1002);
await TryCloseAsync(connection, status);
}
return false;

Expand Down
27 changes: 16 additions & 11 deletions frameworks/genhttp-ioxide/genhttp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,27 @@
<GarbageCollectionAdaptationMode>0</GarbageCollectionAdaptationMode>
</PropertyGroup>

<!-- GenHTTP.Engine.Ioxide 11.3.0 pins ioxide 0.15.251; ioxide.pg and ioxide.timer below are
built against the same ioxide, so they move with it. -->
<!-- GenHTTP from source, cloned by the Dockerfile into GenHttpSource (see there). Its
GenHTTP.Engine.Ioxide pins ioxide 0.26.563; ioxide.pg and ioxide.timer below are built
against the same ioxide, so they move with it. -->
<PropertyGroup>
<GenHttpSource Condition="'$(GenHttpSource)' == ''">/genhttp</GenHttpSource>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GenHTTP.Engine.Ioxide" Version="11.3.0" />
<PackageReference Include="GenHTTP.Modules.IO" Version="11.3.0" />
<PackageReference Include="GenHTTP.Modules.Files" Version="11.3.0" />
<PackageReference Include="GenHTTP.Modules.Layouting" Version="11.3.0" />
<PackageReference Include="GenHTTP.Modules.Webservices" Version="11.3.0" />
<PackageReference Include="GenHTTP.Modules.Compression" Version="11.3.0" />
<PackageReference Include="GenHTTP.Modules.Websockets" Version="11.3.0" />
<ProjectReference Include="$(GenHttpSource)/Engine/Ioxide/GenHTTP.Engine.Ioxide.csproj" />
<ProjectReference Include="$(GenHttpSource)/Modules/IO/GenHTTP.Modules.IO.csproj" />
<ProjectReference Include="$(GenHttpSource)/Modules/Files/GenHTTP.Modules.Files.csproj" />
<ProjectReference Include="$(GenHttpSource)/Modules/Layouting/GenHTTP.Modules.Layouting.csproj" />
<ProjectReference Include="$(GenHttpSource)/Modules/Webservices/GenHTTP.Modules.Webservices.csproj" />
<ProjectReference Include="$(GenHttpSource)/Modules/Compression/GenHTTP.Modules.Compression.csproj" />
<ProjectReference Include="$(GenHttpSource)/Modules/Websockets/GenHTTP.Modules.Websockets.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ioxide.pg" Version="0.15.251" />
<PackageReference Include="ioxide.pg" Version="0.26.563" />
<!-- Ring-native timeouts for /delay: the wait completes on the reactor, not the thread pool. -->
<PackageReference Include="ioxide.timer" Version="0.15.251" />
<PackageReference Include="ioxide.timer" Version="0.26.563" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="11.0.0-preview.5.26302.115" />
</ItemGroup>

Expand Down
Loading