Add both Basic auth and CGI support

This commit is contained in:
2025-12-04 13:24:23 -06:00
parent abe444d22b
commit 2861fba6f2
15 changed files with 315 additions and 18 deletions

View File

@@ -129,9 +129,16 @@ namespace Tesses::Framework::Streams {
#else
struct ifaddrs *ifAddrStruct = NULL;
getifaddrs(&ifAddrStruct);
errno = 0;
if(getifaddrs(&ifAddrStruct) == -1)
{
freeifaddrs(ifAddrStruct);
return {};
}
for (struct ifaddrs *ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next) {
if (ifa->ifa_addr == NULL)
continue;
if (ifa->ifa_addr->sa_family == AF_INET) { // IPv4
ipConfig.push_back(std::pair<std::string,std::string>(ifa->ifa_name, StringifyIP(ifa->ifa_addr)));

View File

@@ -1,4 +1,5 @@
#include "TessesFramework/Streams/Stream.hpp"
#include <iostream>
namespace Tesses::Framework::Streams {
int32_t Stream::ReadByte()
@@ -108,6 +109,7 @@ namespace Tesses::Framework::Streams {
read = (size_t)std::min(len-offset,(uint64_t)buffSize);
read = this->Read(buffer,read);
strm->WriteBlock(buffer, read);
offset += read;
@@ -122,8 +124,6 @@ namespace Tesses::Framework::Streams {
{
size_t read;
uint8_t* buffer = new uint8_t[buffSize];
do {
read = this->Read(buffer,buffSize);
strm->WriteBlock(buffer, read);