+
+void load_url_async_cancel(struct load_url_result *res)
+{
+ struct load_task *task = res->task;
+
+ /* the completion callback may have already been called; this clears
+ * res->task */
+ if (!task)
+ return;
+
+ if (res->status == LOAD_CANCELLED)
+ return;
+
+ assert(task->async);
+ assert(task->process);
+
+ res->status = LOAD_CANCELLED;
+ process_stop_async(task->process);
+}
+
+#else
+
+static void __attribute__((unused)) load_local(
+ struct load_task *task __attribute__((unused)))
+{
+}
+static void __attribute__((unused)) load_wget(
+ struct load_task *task __attribute__((unused)),
+ int flags __attribute__((unused)))
+{
+}
+static void __attribute__((unused)) load_tftp(
+ struct load_task *task __attribute__((unused)))
+{
+}
+static void __attribute__((unused)) load_sftp(
+ struct load_task *task __attribute__((unused)))
+{
+}
+static void __attribute__((unused)) load_nfs(
+ struct load_task *task __attribute__((unused)))
+{
+}
+static void __attribute__((unused)) load_url_process_exit(
+ struct process *process __attribute__((unused)))
+{
+}
+
+#endif