Commit 3db584a3 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

curl/Easy: add SetReadFunction()

parent 409002b1
......@@ -119,6 +119,10 @@ public:
SetOption(CURLOPT_USERPWD, userpwd);
}
void SetUpload(bool value=true) {
SetOption(CURLOPT_UPLOAD, (long)value);
}
void SetNoProgress(bool value=true) {
SetOption(CURLOPT_NOPROGRESS, (long)value);
}
......@@ -154,6 +158,13 @@ public:
SetOption(CURLOPT_WRITEDATA, userdata);
}
void SetReadFunction(size_t (*function)(char *ptr, size_t size,
size_t nmemb, void *userdata),
void *userdata) {
SetOption(CURLOPT_READFUNCTION, function);
SetOption(CURLOPT_READDATA, userdata);
}
void SetNoBody(bool value=true) {
SetOption(CURLOPT_NOBODY, (long)value);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment