[ostree] metalink: Allow NULL for "out" params in metalink requests
- From: Giuseppe Scrivano <gscrivano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] metalink: Allow NULL for "out" params in metalink requests
- Date: Fri, 26 Jun 2015 09:15:17 +0000 (UTC)
commit ebef43eabe260333efaaffc19859d6ef4d98a3d4
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Jun 10 14:37:42 2015 -0400
metalink: Allow NULL for "out" params in metalink requests
Caller may not be interested in all the outbound params, particularly
"fetching_sync_uri".
src/libostree/ostree-metalink.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/libostree/ostree-metalink.c b/src/libostree/ostree-metalink.c
index cbe859f..56bd12f 100644
--- a/src/libostree/ostree-metalink.c
+++ b/src/libostree/ostree-metalink.c
@@ -648,8 +648,10 @@ ostree_metalink_request_finish (OstreeMetalink *self,
if (g_task_propagate_boolean ((GTask*)result, error))
{
g_assert_cmpint (request->current_url_index, <, request->urls->len);
- *out_target_uri = request->urls->pdata[request->current_url_index];
- *out_data = g_strdup (request->result);
+ if (out_target_uri != NULL)
+ *out_target_uri = request->urls->pdata[request->current_url_index];
+ if (out_data != NULL)
+ *out_data = g_strdup (request->result);
return TRUE;
}
else
@@ -708,7 +710,9 @@ _ostree_metalink_request_sync (OstreeMetalink *self,
data.out_data = out_data;
data.loop = loop;
data.error = error;
- *fetching_sync_uri = _ostree_metalink_get_uri (self);
+
+ if (fetching_sync_uri != NULL)
+ *fetching_sync_uri = _ostree_metalink_get_uri (self);
request->metalink = g_object_ref (self);
request->urls = g_ptr_array_new_with_free_func ((GDestroyNotify) soup_uri_free);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]