EntropyEngine::Networking::WebDAV::WebDAVConnection
EntropyEngine::Networking::WebDAV::WebDAVConnection
Section titled “EntropyEngine::Networking::WebDAV::WebDAVConnection”HTTP/1.1 client for WebDAV operations. More…
#include <WebDAVConnection.h>
Public Classes
Section titled “Public Classes”| Name | |
|---|---|
| struct | StreamState Internal state for streaming GET operations. |
| class | StreamHandle Handle to active streaming GET operation. |
| struct | StreamConfig Configuration for streaming GET operations. |
| struct | Response HTTP response for aggregated operations. |
| struct | PendingResponse Internal state for aggregated HTTP requests. |
| struct | Config Connection configuration. |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| ~WebDAVConnection() Destructor ensures clean shutdown. | |
| void | resumeIfPaused() Resumes a paused streaming parser if there is now buffer capacity. |
| Response | propfind(const std::string & path, int depth, const std::string & bodyXml) Performs WebDAV PROPFIND request. |
| StreamHandle | openGetStream(const std::string & path, const StreamConfig & cfg) Opens streaming GET request for large downloads. |
| bool | isConnected() const Checks if underlying connection is connected. |
| Response | head(const std::string & path, const std::vector< std::pair< std::string, std::string > > & extraHeaders ={}) Performs HTTP HEAD request. |
| Response | get(const std::string & path, const std::vector< std::pair< std::string, std::string > > & extraHeaders ={}) Performs HTTP GET request. |
| void | abortActiveRequest() Aborts active request (aggregated or streaming). |
| WebDAVConnection(std::shared_ptr< EntropyEngine::Networking::NetworkConnection > nc, Config cfg) Constructs WebDAV connection. |
Detailed Description
Section titled “Detailed Description”class EntropyEngine::Networking::WebDAV::WebDAVConnection;HTTP/1.1 client for WebDAV operations.
Provides synchronous HTTP methods (GET, HEAD, PROPFIND) with aggregated response bodies, plus streaming GET for large file downloads. Uses llhttp for parsing and supports HTTP/1.1 keep-alive.
Thread Safety: Only one request per connection at a time. For concurrent requests, use multiple connections via WebDAVFileSystemBackend::setAggregateConnections().
WebDAVConnection::Config cfg{.host = "example.com"};auto conn = std::make_shared<WebDAVConnection>(netConn, cfg);auto response = conn->get("/path/to/file");if (response.isSuccess()) { processBody(response.body);}Public Functions Documentation
Section titled “Public Functions Documentation”function ~WebDAVConnection
Section titled “function ~WebDAVConnection”~WebDAVConnection()Destructor ensures clean shutdown.
Prevents new callbacks, waits for in-flight callbacks to complete, then safely cleans up active requests.
function resumeIfPaused
Section titled “function resumeIfPaused”void resumeIfPaused()Resumes a paused streaming parser if there is now buffer capacity.
function propfind
Section titled “function propfind”Response propfind( const std::string & path, int depth, const std::string & bodyXml)Performs WebDAV PROPFIND request.
Parameters:
- path Request path (e.g., “/dav/folder/”)
- depth Depth header value (0 for resource, 1 for immediate children)
- bodyXml XML request body specifying properties to retrieve
Return: Response with 207 Multistatus XML body
function openGetStream
Section titled “function openGetStream”StreamHandle openGetStream( const std::string & path, const StreamConfig & cfg)Opens streaming GET request for large downloads.
Parameters:
- path Request path
- cfg Stream configuration (buffer size, headers)
Exceptions:
- std::runtime_error if another request is already active
Return: StreamHandle providing access to streaming state
Starts HTTP GET in background with ring buffer for incremental reads. Use with WebDAVReadStream to consume data.
function isConnected
Section titled “function isConnected”inline bool isConnected() constChecks if underlying connection is connected.
Return: true if NetworkConnection reports connected state
function head
Section titled “function head”Response head( const std::string & path, const std::vector< std::pair< std::string, std::string > > & extraHeaders ={})Performs HTTP HEAD request.
Parameters:
- path Request path
- extraHeaders Additional headers to include
Return: Response with status and headers (no body)
function get
Section titled “function get”Response get( const std::string & path, const std::vector< std::pair< std::string, std::string > > & extraHeaders ={})Performs HTTP GET request.
Parameters:
- path Request path (e.g., “/dav/file.txt”)
- extraHeaders Additional headers to include
Return: Response with status, headers, and body
function abortActiveRequest
Section titled “function abortActiveRequest”void abortActiveRequest()Aborts active request (aggregated or streaming).
Marks active request as failed and wakes waiting threads.
function WebDAVConnection
Section titled “function WebDAVConnection”WebDAVConnection( std::shared_ptr< EntropyEngine::Networking::NetworkConnection > nc, Config cfg)Constructs WebDAV connection.
Parameters:
- nc Underlying network connection (must be connected)
- cfg Connection configuration (host, auth, timeouts)
Updated on 2026-01-26 at 16:50:32 -0500