31#define _Class _URLSessionUploadTask
33#pragma mark - URLSessionTask
42 const size_t bytesRead = fread(
data, size, count, this->file);
43 this->urlSessionTask.bytesSent += bytesRead;
59 int err = fseek(this->file, 0, SEEK_END);
64 err = fseek(this->file, 0, SEEK_SET);
70 curl_easy_setopt(self->locals.
handle, CURLOPT_READDATA, self);
73#pragma mark - Class lifecycle
93 .name =
"URLSessionUploadTask",
97 .interfaceSize =
sizeof(URLSessionUploadTaskInterface),
Class * _initialize(const ClassDef *def)
Initializes the given Class.
#define super(type, obj, method,...)
void * ident
The identity type, similar to Objective-C id.
static size_t readFunction(char *data, size_t size, size_t count, ident self)
The CURLOPT_READFUNCTION callback.
static void initialize(Class *clazz)
Use upload tasks to send files directly from disk.
#define do_once(once, block)
Executes the given block at most one time.
ClassDefs are passed to _initialize via an archetype to initialize a Class.
The runtime representation of a Class.
ident interface
The interface of the Class.
MutableData * data(void)
Returns a new MutableData.
URL session tasks are handles to pending URL operations.
ident handle
The backing libcurl handle.
void setup(URLSessionTask *)
Sets up this task.
size_t bytesExpectedToSend
The count of bytes this task expects to send.
Class * _URLSessionTask(void)
The URLSessionTask archetype.
Use upload tasks to send files directly from disk.
Class * _URLSessionUploadTask(void)
The URLSessionUploadTask archetype.