Skip to content

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>

Name
structStreamState
Internal state for streaming GET operations.
classStreamHandle
Handle to active streaming GET operation.
structStreamConfig
Configuration for streaming GET operations.
structResponse
HTTP response for aggregated operations.
structPendingResponse
Internal state for aggregated HTTP requests.
structConfig
Connection configuration.
Name
~WebDAVConnection()
Destructor ensures clean shutdown.
voidresumeIfPaused()
Resumes a paused streaming parser if there is now buffer capacity.
Responsepropfind(const std::string & path, int depth, const std::string & bodyXml)
Performs WebDAV PROPFIND request.
StreamHandleopenGetStream(const std::string & path, const StreamConfig & cfg)
Opens streaming GET request for large downloads.
boolisConnected() const
Checks if underlying connection is connected.
Responsehead(const std::string & path, const std::vector< std::pair< std::string, std::string > > & extraHeaders ={})
Performs HTTP HEAD request.
Responseget(const std::string & path, const std::vector< std::pair< std::string, std::string > > & extraHeaders ={})
Performs HTTP GET request.
voidabortActiveRequest()
Aborts active request (aggregated or streaming).
WebDAVConnection(std::shared_ptr< EntropyEngine::Networking::NetworkConnection > nc, Config cfg)
Constructs WebDAV connection.
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);
}
~WebDAVConnection()

Destructor ensures clean shutdown.

Prevents new callbacks, waits for in-flight callbacks to complete, then safely cleans up active requests.

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.

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

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.

inline bool isConnected() const

Checks if underlying connection is connected.

Return: true if NetworkConnection reports connected state

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)

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

void abortActiveRequest()

Aborts active request (aggregated or streaming).

Marks active request as failed and wakes waiting threads.

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