UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
HttpConnectionRequestReadContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3#include "CoreMinimal.h"
5
7struct FHttpConnection;
8
9class FSocket;
10
12
14{
15public:
16
23
31
36 {
37 return Request;
38 }
39
44 void ResetContext();
45
50 {
51 return SecondsWaitingForReadableSocket;
52 }
53
58 {
59 SecondsWaitingForReadableSocket += Seconds;
60 }
61
66 {
67 SecondsWaitingForReadableSocket = 0.f;
68 }
69
70private:
71
79 bool ParseHeader(uint8* ByteBuffer, int32 BufferLen);
80
88 bool ParseBody(uint8* ByteBuffer, int32 BufferLen);
89
98 bool IsRequestValid(const FHttpServerRequest& InRequest);
99
106 TSharedPtr<FHttpServerRequest> BuildRequest(const FString& RequestHeader);
107
115 static bool ParseContentLength(const FHttpServerRequest& InRequest, int32& OutContentLength);
116
117private:
118
120 FSocket* Socket;
124 bool bParseHeaderComplete = false;
126 bool bParseBodyComplete = false;
128 TArray<uint8> HeaderBytes;
130 int32 IncomingRequestBodyBytesToRead = 0;
132 float SecondsWaitingForReadableSocket = 0.f;
133};
#define FORCEINLINE
Definition AndroidPlatform.h:140
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EHttpConnectionContextState
Definition HttpConnectionContext.h:8
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Sockets.h:19
Definition Array.h:670
Definition SharedPointer.h:692
Definition HttpConnectionContext.h:16
Definition HttpConnectionRequestReadContext.h:14
void ResetContext()
Definition HttpConnectionRequestReadContext.cpp:20
EHttpConnectionContextState ReadStream(float DeltaTime)
Definition HttpConnectionRequestReadContext.cpp:33
void ResetSecondsWaitingForReadableSocket()
Definition HttpConnectionRequestReadContext.h:65
void AddSecondsWaitingForReadableSocket(float Seconds)
Definition HttpConnectionRequestReadContext.h:57
FORCEINLINE TSharedPtr< FHttpServerRequest > GetRequest() const
Definition HttpConnectionRequestReadContext.h:35
float GetSecondsWaitingForReadableSocket() const
Definition HttpConnectionRequestReadContext.h:49
Definition HttpConnection.h:23
Definition HttpServerRequest.h:24