mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 23:00:07 +01:00
First note that all three provider implementations are very similar.
That is why NMCSProvider's implementation does already some work that
is common to all implementations. For example, it provides the
NMCSProviderGetConfigTaskData structure to help tracking the data of
the request.
Also note that the GCP/Azure implementations didn't handle the
cancellation correctly. They always would pass
g_task_get_cancellable(get_config_data->task)
to the asynchronous requests. That is the GCancellable provider by the
caller. That is fine when there is only one async operation ongoing. But
that is not the case, we have parallel HTTP requests.
Then, when an error happened, the overall get_config() operations fails
and the still pending requests should all be aborted. However, we must
not cancel the GCancellable of the user (because that is not owned by us).
The correct solution is to use an internal cancellable in those cases.
Anyway. Since all of this is similar, we can extend the base class
to handle things for us. This also gets the cancellation right by having
a "get_config_data->intern_cancellable".
|
||
|---|---|---|
| .. | ||
| 90-nm-cloud-setup.sh | ||
| main.c | ||
| meson.build | ||
| nm-cloud-setup-utils.c | ||
| nm-cloud-setup-utils.h | ||
| nm-cloud-setup.service.in | ||
| nm-cloud-setup.timer | ||
| nm-http-client.c | ||
| nm-http-client.h | ||
| nmcs-provider-azure.c | ||
| nmcs-provider-azure.h | ||
| nmcs-provider-ec2.c | ||
| nmcs-provider-ec2.h | ||
| nmcs-provider-gcp.c | ||
| nmcs-provider-gcp.h | ||
| nmcs-provider.c | ||
| nmcs-provider.h | ||