Skip to content

Commit

Permalink
Merge pull request #23 from sm00th/https_segfault
Browse files Browse the repository at this point in the history
https segfault fix
  • Loading branch information
p3ck committed Oct 29, 2014
2 parents 5e691e1 + a601a1e commit 3c56daf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ restraint_task_fetch(AppData *app_data) {

switch (task->fetch_method) {
case TASK_FETCH_UNPACK:
if (g_strcmp0(soup_uri_get_scheme(task->fetch.url), "git") == 0) {
{
const char *scheme = soup_uri_get_scheme(task->fetch.url);
if (g_strcmp0(scheme, "git") == 0) {
restraint_fetch_git (task->fetch.url,
task->path,
archive_entry_callback,
fetch_finish_callback,
app_data);
} else if (g_strcmp0(soup_uri_get_scheme(task->fetch.url), "http") == 0) {
} else if (g_strcmp0(scheme, "http") == 0 ||
g_strcmp0(scheme, "https") == 0 ) {
restraint_fetch_http (task->fetch.url,
task->path,
archive_entry_callback,
Expand All @@ -98,10 +101,10 @@ restraint_task_fetch(AppData *app_data) {
RESTRAINT_TASK_RUNNER_SCHEMA_ERROR,
"Unimplemented schema method %s", soup_uri_get_scheme(task->fetch.url));
fetch_finish_callback (error, app_data);
g_clear_error (&error);
return;
}
break;
}
case TASK_FETCH_INSTALL_PACKAGE:
;
gchar *command = g_strdup_printf ("yum -y install %s", task->fetch.package_name);
Expand All @@ -120,7 +123,6 @@ restraint_task_fetch(AppData *app_data) {
RESTRAINT_TASK_RUNNER_FETCH_ERROR,
"Unknown fetch method");
fetch_finish_callback (error, app_data);
g_clear_error (&error);
g_return_if_reached();
}
}
Expand Down

0 comments on commit 3c56daf

Please sign in to comment.