mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 17:00:40 +01:00
cloud-setup: don't pass separate user-data when polling in nm_http_client_poll_req()
nmcs_utils_poll() accepts two different user-data. One is passed to the probe callbacks (and returned by nmcs_utils_poll_finish()). The other one is passed to the callback. Having separate user data might be useful. It's not useful for nm_http_client_poll_req(), which both passes the same. It's confusing to pass the same data as different user-data. Don't do that. Use only one way.
This commit is contained in:
parent
82a9a493af
commit
841e06be5e
1 changed files with 4 additions and 3 deletions
|
|
@ -508,13 +508,14 @@ _poll_req_probe_finish_fcn(GObject *source,
|
|||
static void
|
||||
_poll_req_done_cb(GObject *source, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
PollReqData *poll_req_data = user_data;
|
||||
PollReqData *poll_req_data = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
gboolean success;
|
||||
|
||||
success = nmcs_utils_poll_finish(result, NULL, &error);
|
||||
success = nmcs_utils_poll_finish(result, (gpointer *) &poll_req_data, &error);
|
||||
|
||||
nm_assert((!!success) == (!error));
|
||||
nm_assert(poll_req_data);
|
||||
|
||||
if (error)
|
||||
g_task_return_error(poll_req_data->task, g_steal_pointer(&error));
|
||||
|
|
@ -582,7 +583,7 @@ nm_http_client_poll_req(NMHttpClient *self,
|
|||
poll_req_data,
|
||||
cancellable,
|
||||
_poll_req_done_cb,
|
||||
poll_req_data);
|
||||
NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue