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:
Thomas Haller 2023-02-27 15:45:56 +01:00
parent 82a9a493af
commit 841e06be5e
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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