metalink: Allow NULL for "out" params in metalink requests

Caller may not be interested in all the outbound params, particularly
"fetching_sync_uri".
This commit is contained in:
Matthew Barnes 2015-06-10 14:37:42 -04:00 committed by Giuseppe Scrivano
parent 3515e01f6a
commit ebef43eabe

View File

@ -648,7 +648,9 @@ ostree_metalink_request_finish (OstreeMetalink *self,
if (g_task_propagate_boolean ((GTask*)result, error))
{
g_assert_cmpint (request->current_url_index, <, request->urls->len);
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;
}
@ -708,6 +710,8 @@ _ostree_metalink_request_sync (OstreeMetalink *self,
data.out_data = out_data;
data.loop = loop;
data.error = error;
if (fetching_sync_uri != NULL)
*fetching_sync_uri = _ostree_metalink_get_uri (self);
request->metalink = g_object_ref (self);