Skip to content

Commit 8a131ec

Browse files
authored
Merge pull request #14 from MDA2AV/9.0.6
9.0.7
2 parents 3e0cbac + b49d0f1 commit 8a131ec

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

Unhinged/Engine/UnhingedEngine.Worker.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ private static unsafe void WorkerLoop(Worker W)
239239
}
240240

241241
/// <summary>
242-
/// Parses as many complete HTTP requests as are present in the receive buffer.
242+
/// Parses as many complete HTTP requests as are present in the receiving buffer.
243243
/// For each complete request:
244244
/// - extracts the route
245245
/// - invokes the configured request handler to stage a response into WriteBuffer
246-
/// The receive window is compacted when partial data remains.
246+
/// The receiving window is compacted when partial data remains.
247247
/// Returns true if any response data was staged and should be flushed.
248248
/// </summary>
249249
private static async ValueTask TryParseRequests(
@@ -275,6 +275,7 @@ private static async ValueTask TryParseRequests(
275275
await _sRequestHandler(connection);
276276

277277
// Clear pooled dictionaries (query parameters + headers)
278+
// Currently Clear won't reset the buffers, if it changes, adapt here too
278279
connection.Clear();
279280

280281
// Mark that there is data to flush (a request was fully processed)

Unhinged/Engine/Worker.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,23 @@ public bool IsUsed(int index)
131131

132132
public void Dispose()
133133
{
134-
try { if (Ep >= 0) close(Ep); } catch { /* log */ }
135-
try { if (NotifyEfd >= 0) close(NotifyEfd); } catch { /* log */ }
136-
if (EventsBuf != IntPtr.Zero) Marshal.FreeHGlobal(EventsBuf);
134+
try
135+
{
136+
if (Ep >= 0)
137+
close(Ep);
138+
139+
} catch { /* log */ }
140+
141+
try
142+
{
143+
if (NotifyEfd >= 0)
144+
close(NotifyEfd);
145+
146+
} catch { /* log */ }
147+
148+
if (EventsBuf != IntPtr.Zero)
149+
Marshal.FreeHGlobal(EventsBuf);
150+
137151
// Optionally GC.SuppressFinalize(this);
138152
}
139153
}

0 commit comments

Comments
 (0)