mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-26 04:06:22 +00:00
Refactor for threaded external executable for built-in download methods
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#include <gio/gio.h>
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "profanity.h"
|
||||
#include "event/client_events.h"
|
||||
@@ -187,6 +188,25 @@ http_file_get(void* userdata)
|
||||
download_processes = g_slist_remove(download_processes, download);
|
||||
pthread_mutex_unlock(&lock);
|
||||
|
||||
if (download->cmd_template != NULL) {
|
||||
gchar** argv = format_call_external_argv(download->cmd_template,
|
||||
download->url,
|
||||
download->filename);
|
||||
|
||||
// TODO(wstrm): Log the error.
|
||||
if (!call_external(argv, NULL, NULL)) {
|
||||
http_print_transfer_update(download->window, download->url,
|
||||
"Downloading '%s' failed: Unable to call "
|
||||
"command '%s' with file at '%s' (%s).",
|
||||
download->url,
|
||||
download->cmd_template,
|
||||
download->filename,
|
||||
"TODO(wstrm): Log the error");
|
||||
}
|
||||
|
||||
g_strfreev(argv);
|
||||
}
|
||||
|
||||
free(download->url);
|
||||
free(download->filename);
|
||||
free(download);
|
||||
|
||||
Reference in New Issue
Block a user