summaryrefslogtreecommitdiff
path: root/src/lib/curl
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-01-19 11:12:41 +0100
committerMax Kellermann <max@musicpd.org>2018-01-20 00:28:54 +0100
commitc3b85685608c4d2767792975c4630b7348989f02 (patch)
tree4ace802fbc55476a1ecc66eef6f813101efefa01 /src/lib/curl
parent8bd95a4eb10b0dc80a1aed4995fb9cb5dc9f75e5 (diff)
lib/curl/Handler: add API documentation
Diffstat (limited to 'src/lib/curl')
-rw-r--r--src/lib/curl/Handler.hxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/curl/Handler.hxx b/src/lib/curl/Handler.hxx
index c92f9e9b5..22c1a0db2 100644
--- a/src/lib/curl/Handler.hxx
+++ b/src/lib/curl/Handler.hxx
@@ -36,12 +36,34 @@
#include <string>
#include <map>
+/**
+ * Asynchronous response handler for a #CurlRequest.
+ *
+ * Its methods must be thread-safe.
+ */
class CurlResponseHandler {
public:
+ /**
+ * Status line and headers have been received.
+ */
virtual void OnHeaders(unsigned status,
std::multimap<std::string, std::string> &&headers) = 0;
+
+ /**
+ * Response body data has been received.
+ */
virtual void OnData(ConstBuffer<void> data) = 0;
+
+ /**
+ * The response has ended. The method is allowed delete the
+ * #CurlRequest here.
+ */
virtual void OnEnd() = 0;
+
+ /**
+ * An error has occurred. The method is allowed delete the
+ * #CurlRequest here.
+ */
virtual void OnError(std::exception_ptr e) noexcept = 0;
};