aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp
Commit message (Collapse)AuthorAgeFilesLines
* made http.sys async worker thread pool configurable via the same option as ↵Stefan Boberg2026-02-201-1/+2
| | | | | | the main I/O pool this is also to gain control over threads to improve shutdown behaviour
* added new I/O thread pool implementationStefan Boberg2026-02-206-28/+363
| | | | | | the new variant manages a dynamically growing/shrinking set of threads manually instead of relying on the built-in Windows thread pool the benefit of this is that we're in charge of setup and teardown so can make better guarantees about lifetimes of threads which can help with shutdown issues
* GC - fix handling of attachment ranges, http access token expiration, lock ↵Stefan Boberg2026-02-202-4/+7
| | | | | | | | file retry logic (#766) * GC - fix handling of attachment ranges * fix trace/log strings * fix HTTP access token expiration time logic * added missing lock retry in zenserver startup
* add selective request logging support to http.sys (#762)Stefan Boberg2026-02-181-3/+22
| | | | | * implemented selective request logging for http.sys for consistency with asio * fixed traversal of GetLogicalProcessorInformationEx to account for variable-sized records * also adds CPU usage metrics
* add http server root password protection (#757)Dan Engelbrecht2026-02-1714-150/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Feature: Added `--security-config-path` option to zenserver to configure security settings - Expects a path to a .json file - Default is an empty path resulting in no extra security settings and legacy behavior - Current support is a top level filter of incoming http requests restricted to the `password` type - `password` type will check the `Authorization` header and match it to the selected authorization strategy - Currently the security settings is very basic and configured to a fixed username+password at startup { "http" { "root": { "filter": { "type": "password", "config": { "password": { "username": "<username>", "password": "<password>" }, "protect-machine-local-requests": false, "unprotected-uris": [ "/health/", "/health/info", "/health/version" ] } } } } }
* misc fixes brought over from sb/proto (#759)Stefan Boberg2026-02-174-20/+38
| | | | | | | | * `RwLock::WithSharedLock` and `RwLock::WithExclusiveLock` can now return a value (which is returned by the passed function) * Comma-separated logger specification now correctly deals with commas * `GetSystemMetrics` properly accounts for cores * cpr response formatter passes arguments in the right order * `HttpServerRequest::SetLogRequest` can be used to selectively log HTTP requests
* add foundation for http password protection (#756)Dan Engelbrecht2026-02-133-0/+275
|
* add IHttpRequestFilter to allow server implementation to filter/reject ↵Dan Engelbrecht2026-02-1310-96/+353
| | | | | requests (#753) * add IHttpRequestFilter to allow server implementation to filter/reject requests
* add IsLocalMachineRequest to HttpServerRequest (#749)Dan Engelbrecht2026-02-126-7/+78
| | | * add IsLocalMachineRequest to HttpServerRequest
* add simple http client tests (#751)Dan Engelbrecht2026-02-128-27/+202
| | | * add simple http client tests and fix run loop of http server to not rely on application quit
* only check file size for requested range in asio TransmitFileAsync in debug ↵Dan Engelbrecht2026-02-061-41/+63
| | | | | | mode (#745) * only check file size for requested range in asio TransmitFileAsync in debug mode * only do Transmit file for whole files
* Merge pull request #723 from ue-foundation/lm/service-interactive-sessionLiam Mitchell2026-02-044-40/+16
|\ | | | | Run Windows service as an interactive session, so we correctly respond to RequestApplicationExit when requested to stop by the service manager
| * Respond to RequestApplicationExit() in http server implementations even in ↵Liam Mitchell2026-01-294-40/+16
| | | | | | | | non-interactive sessions
* | implemented chunking for TransmitFile path (#736)Stefan Boberg2026-02-041-58/+119
| | | | | | | | | | * implemented chunking for TransmitFile path, to ensure payloads exceeding the TransmitFile API limit of 4GB can be handled * also fixes similar issue with memory path
* | reduce batch size for reads (#740)Dan Engelbrecht2026-01-291-1/+1
| | | | | | | | | | * reduce maximum size per chunk to read to reduce disk contention * increase timeout before warning on slow shut down of zenserver * reduce default window size for blockstore chunk iteration
* | hotfix 5.7.18 (#730)Dan Engelbrecht2026-01-221-3/+3
|/ | | | * make sure we properly convert command line args for zenserver as well * make sure we *add* wildcards/excludes in addition to defaults
* zenserver API changes, some other minor changes (#720)Stefan Boberg2026-01-191-1/+1
| | | | | | | * add system metrics output to top command * removed unnecessary xmake directives * file system API/comment tweaks * fixed out-of-range access in httpserver test * updated ZenServer base API to allow customization by mode
* remove ZENCORE_API completely (#718)Stefan Boberg2026-01-191-2/+2
| | | initially we had ZENCORE_API macros to potentially allow for DLL linkage. It turns out that this is not useful and the macros just contribute noise, so this change removes them completely.
* OTLP/trace improvements (#717)Stefan Boberg2026-01-191-4/+6
| | | | | | | This PR brings over some changes made to avoid performing setup for otel instrumentation if we are not sending otel information anywhere anyway. It also adds the ability to configure an OTLP endpoint on the command line using `--otlp-endpoint=<URI>`. Bear in mind that OTLP support is still not officially supported so this should not be used in production at this stage.
* asio/http optimizations (#449)Stefan Boberg2026-01-141-104/+638
| | | | | | | This change primarily introduces improved logic for dealing with sending data from file references. This is intended to reduce the amount of memory-mapping we end up doing when sending data from files. Windows now uses `TransmitFile` to send file data more efficiently using kernel-side I/O, but Linux/Mac basically behaves as before since they don't offer any true async file I/O support via asio. This should be implemented separately using a background I/O thread pool. This PR also includes improved memory management for http/asio with reduced allocation counts, and a fix for a potential use-after-free in very high load scenarios.
* CprHttpClient cleanup (#703)Dan Engelbrecht2026-01-092-7/+3
|
* Add base port getter and set the dll directory for plugin dependencies (#692)Tomasz Obrębski2025-12-192-7/+20
| | | | | | | * Add base port getter and set the dll directory for plugin dependencies * Use UTF8 for dll paths * Rename BasePort to m_BasePort for consistency
* remove error warning in output (#695)Dan Engelbrecht2025-12-172-9/+9
| | | * changed some logging string so they don't get caught in CI logging
* add otel instrumentation (#581)Stefan Boberg2025-12-115-21/+141
| | | | | | | | this change adds OTEL tracing to a few places * Top-level application lifecycle (config/init/cleanup, main loop) * http.sys requests it also brings some otlptrace optimizations and dynamic configuration of tracing. OTLP tracing is currently always disabled
* HTTP server API changes for improved extensibility (#684)Stefan Boberg2025-12-1111-55/+177
| | | | * refactored `HttpServer` so all subclass member functions are proctected, to make it easier to extend base functionality * added API service, can be used to enumerate registered endpoints (at `/api`). Currently only very basic information is provided
* fix reading of stale iterator when doing download-resume (#681)Dan Engelbrecht2025-12-091-9/+9
|
* implement --dedicated option on asio http server (#679)Dan Engelbrecht2025-12-054-45/+101
| | | * implement --dedicated option on asio http server
* fix crash when parsing empty key in httpstats service (#671)Dan Engelbrecht2025-12-011-2/+1
|
* automatic scrub on startup (#667)Dan Engelbrecht2025-11-271-1/+1
| | | | | - Improvement: Deeper validation of data when scrub is activated (cas/cache/project) - Improvement: Enabled more multi threading when running scrub operations - Improvement: Added means to force a scrub operation at startup with a new release using ZEN_DATA_FORCE_SCRUB_VERSION variable in xmake.lua
* Add regex-free route matching support (#662)Stefan Boberg2025-11-242-50/+474
| | | | | This change adds support for non-regex matching of routes. Instead of using regex patterns you can associate matcher functions with pattern names and string literal components are identified and matched directly. Also implemented tests for `HttpRequestRouter` class.
* add `--boost-worker-memory` option to zen builds (#639)Dan Engelbrecht2025-11-102-6/+7
|
* switch to xmake for package management (#611)Stefan Boberg2025-11-071-20/+2
| | | | | | | | | | | | | | | | | | | | | | This change removes our dependency on vcpkg for package management, in favour of bringing some code in-tree in the `thirdparty` folder as well as using the xmake build-in package management feature. For the latter, all the package definitions are maintained in the zen repo itself, in the `repo` folder. It should now also be easier to build the project as it will no longer depend on having the right version of vcpkg installed, which has been a common problem for new people coming in to the codebase. Now you should only need xmake to build. * Bumps xmake requirement on github runners to 2.9.9 to resolve an issue where xmake on Windows invokes cmake with `v144` toolchain which does not exist * BLAKE3 is now in-tree at `thirdparty/blake3` * cpr is now in-tree at `thirdparty/cpr` * cxxopts is now in-tree at `thirdparty/cxxopts` * fmt is now in-tree at `thirdparty/fmt` * robin-map is now in-tree at `thirdparty/robin-map` * ryml is now in-tree at `thirdparty/ryml` * sol2 is now in-tree at `thirdparty/sol2` * spdlog is now in-tree at `thirdparty/spdlog` * utfcpp is now in-tree at `thirdparty/utfcpp` * xmake package repo definitions is in `repo` * implemented support for sanitizers. ASAN is supported on windows, TSAN, UBSAN, MSAN etc are supported on Linux/MacOS though I have not yet tested it extensively on MacOS * the zencore encryption implementation also now supports using mbedTLS which is used on MacOS, though for now we still use openssl on Linux * crashpad * bumps libcurl to 8.11.0 (from 8.8.0) which should address a rare build upload bug
* add `--verbose-http` option to builds commands (#630)Dan Engelbrecht2025-11-042-0/+55
|
* Various fixes to address issues flagged by gcc / non-UE toolchain build (#621)Stefan Boberg2025-11-012-4/+14
| | | | | | | | | | | | | | | | | | | | * gcc: avoid using memset on nontrivial struct * redundant `return std::move` * fixed various compilation issues flagged by gcc * fix issue in xmake.lua detecting whether we are building with the UE toolchain or not * add GCC ignore -Wundef (comment is inaccurate) * remove redundant std::move * don't catch exceptions by value * unreferenced variables * initialize "by the book" instead of memset * remove unused exception reference * add #include <cstring> to fix gcc build * explicitly poulate KeyValueMap by traversing input spans fixes gcc compilation * remove unreferenced variable * eliminate redundant `std::move` which gcc complains about * fix gcc compilation by including <cstring> * tag unreferenced variable to fix gcc compilation * fixes for various cases of naming members the same as their type
* move cpr in-tree (#605)Stefan Boberg2025-10-241-3/+1
| | | | | | * added cpr 1.10.5 in-tree to allow updates to vcpkg without breaking the build * added asio 1.29.0 in-tree to remove one more vcpkg dependency * bumped vcpkg to 2024.06.15 to address failure to build due to use of deprecated binaries in vcpkg (404 error: `https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst` during build)
* add support for OTLP logging/tracing (#599)Stefan Boberg2025-10-223-2/+7
| | | | | | | | - adds `zentelemetry` project which houses new functionality for serializing logs and traces in OpenTelemetry Protocol format (OTLP) - moved existing stats functionality from `zencore` to `zentelemetry` - adds `TRefCounted<T>` for vtable-less refcounting - adds `MemoryArena` class which allows for linear allocation of memory from chunks - adds `protozero` which is used to encode OTLP protobuf messages
* silence warnings in CprHttpClient if request was aborted (#591)Dan Engelbrecht2025-10-202-197/+219
| | | | * silence warnings in CprHttpClient if request was aborted * refactor CprHttpClient
* add ability to abort http requests (#586)Dan Engelbrecht2025-10-175-27/+76
| | | * add abort-check function to httpclient
* clean up http response formatters (#584)Dan Engelbrecht2025-10-163-50/+61
| | | * remove use of 'error:' in zen output which triggers Horde CI
* make asiohttp work without IPv6 (#562)Stefan Boberg2025-10-131-49/+225
| | | this change makes it possible to use zenserver on hosts where IPv6 has been disabled
* hide http.sys options when unavailable (#568)Stefan Boberg2025-10-131-4/+6
|
* add ability to limit concurrency (#565)Stefan Boberg2025-10-103-3/+3
| | | | | | | | | | | | effective concurrency in zenserver can be limited via the `--corelimit=<N>` option on the command line. Any value passed in here will be used instead of the return value from `std::thread::hardware_concurrency()` if it is lower. * added --corelimit option to zenserver * made sure thread pools are configured lazily and not during global init * added log output indicating effective and HW concurrency * added change log entry * removed debug logging from ZenEntryPoint::Run() also removed main thread naming on Linux since it makes the output from `top` and similar tools confusing (it shows `main` instead of `zenserver`)
* added Hidden option to oidctoken creation with oidc token exe (#556)Dan Engelbrecht2025-10-062-5/+13
|
* fix for RPC replay issue (wrong content-type) (#536)Stefan Boberg2025-10-022-1/+23
| | | | | likely fall-out from HttpClient refactor. The content type used to be explicit via headers but is now taken from the `IoBuffer` also fixed issue which meant the original request session ID would also not be propagated as intended
* HttpClient support for pluggable back-ends (#532)Stefan Boberg2025-09-306-1634/+1942
| | | refactored HttpClient to separate out cpr implementation into separate classes, with an abstract base class to allow plugging in multiple implementations in the future
* make cpr a HttpClient implementation detail (#517)Stefan Boberg2025-09-296-103/+210
| | | | | these changes remove cpr from anything which is not `HttpClient` internals. The goal is to eventually replace cpr with a more direct curl interface to eliminate cpr since it's proven problematic due to their development practices which frequently breaks APIs and prevents us from updating vcpkg. But this PR is limited to refactoring existing cpr code to use `HttpClient` instead.
* fixed ParsePackageMessage error message when mismatched header magic is ↵Stefan Boberg2025-09-291-1/+1
| | | | detected (#521)
* Added `--oidctoken-exe-unattended` to`zen builds` and `zen oplog-download` ↵Dan Engelbrecht2025-09-222-3/+5
| | | | command to use unattended mode when launching oidc-token.exe (#506)
* revise exception vs error (#495)Dan Engelbrecht2025-09-153-10/+18
| | | | | - Change BadAlloc exceptions in GC to warnings - Add explict ASSERT exception catch in http plugin request processing - Make exceptions handled in http request processing to warnings
* add EMode to WorkerTheadPool to avoid thread starvation (#492)Dan Engelbrecht2025-09-102-13/+15
| | | - Improvement: Add a new mode to worker thread pools to avoid starvation of workers which could cause long stalls due to other work begin queued up. UE-305498