aboutsummaryrefslogtreecommitdiff
path: root/lib/Net.Http
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-03-19 21:54:49 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-03-19 21:54:49 -0400
commit9c7b564911080ccd5cbbb9851a0757b05e1e9047 (patch)
treed29ceca64c1463d2cd738f08de5884e8c18ebe7e /lib/Net.Http
parent6d8c3444e09561e5957491b3cc1ae858e0abdd14 (diff)
refactor: JWK overhaul & add length getter to FileUpload
Diffstat (limited to 'lib/Net.Http')
-rw-r--r--lib/Net.Http/src/Core/RequestParse/Http11ParseExtensions.cs6
-rw-r--r--lib/Net.Http/src/FileUpload.cs7
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/Net.Http/src/Core/RequestParse/Http11ParseExtensions.cs b/lib/Net.Http/src/Core/RequestParse/Http11ParseExtensions.cs
index c373310..86535c3 100644
--- a/lib/Net.Http/src/Core/RequestParse/Http11ParseExtensions.cs
+++ b/lib/Net.Http/src/Core/RequestParse/Http11ParseExtensions.cs
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2023 Vaughn Nugent
+* Copyright (c) 2024 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Net.Http
@@ -176,7 +176,7 @@ namespace VNLib.Net.Http.Core
/// <param name="lineBuf">The buffer read data from the transport with</param>
/// <returns>0 if the request line was successfully parsed, a status code if the request could not be processed</returns>
[MethodImpl(MethodImplOptions.AggressiveOptimization | MethodImplOptions.AggressiveInlining)]
- public static HttpStatusCode Http1ParseHeaders(this HttpRequest Request, ref Http1ParseState parseState, ref TransportReader reader, in HttpConfig Config, Span<char> lineBuf)
+ public static HttpStatusCode Http1ParseHeaders(this HttpRequest Request, ref Http1ParseState parseState, ref TransportReader reader, ref readonly HttpConfig Config, Span<char> lineBuf)
{
/*
* Evil mutable struct, get a local mutable reference to the request's
@@ -534,7 +534,7 @@ namespace VNLib.Net.Http.Core
/// <param name="reader">The <see cref="VnStreamReader"/> to read lines from the transport</param>
/// <returns>0 if the request line was successfully parsed, a status code if the request could not be processed</returns>
[MethodImpl(MethodImplOptions.AggressiveOptimization | MethodImplOptions.AggressiveInlining)]
- public static HttpStatusCode Http1PrepareEntityBody(this HttpRequest Request, ref Http1ParseState parseState, ref TransportReader reader, in HttpConfig Config)
+ public static HttpStatusCode Http1PrepareEntityBody(this HttpRequest Request, ref Http1ParseState parseState, ref TransportReader reader, ref readonly HttpConfig Config)
{
/*
* Evil mutable struct, get a local mutable reference to the request's
diff --git a/lib/Net.Http/src/FileUpload.cs b/lib/Net.Http/src/FileUpload.cs
index 794c623..d3104fd 100644
--- a/lib/Net.Http/src/FileUpload.cs
+++ b/lib/Net.Http/src/FileUpload.cs
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2023 Vaughn Nugent
+* Copyright (c) 2024 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Net.Http
@@ -45,6 +45,11 @@ namespace VNLib.Net.Http
public readonly record struct FileUpload(Stream FileData, bool DisposeStream, ContentType ContentType, string? FileName)
{
/// <summary>
+ /// Gets the length of the <see cref="FileData"/> stream
+ /// </summary>
+ public long Length => FileData.Length;
+
+ /// <summary>
/// Disposes the stream if the handle is owned
/// </summary>
public readonly void Free()