summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-01-05 10:20:41 +0100
committerThomas Haller <thaller@redhat.com>2021-01-08 15:24:43 +0100
commit5fb2f7e717be727c596651f6e0ebdad4c91ecc39 (patch)
tree650814697d4b273f4230be993d2bff593197f1b4
parent9afdbb97ea762831209163c924c3f4cd4435b17e (diff)
downloadNetworkManager-5fb2f7e717be727c596651f6e0ebdad4c91ecc39.tar.gz
cloud-setup/trivial: rename "response_data" variable
We have three implementations of providers, that all do something similar. Name the variable with the HTTP response GBytes the same everywhere.
-rw-r--r--clients/cloud-setup/nmcs-provider-azure.c4
-rw-r--r--clients/cloud-setup/nmcs-provider-ec2.c24
-rw-r--r--clients/cloud-setup/nmcs-provider-gcp.c4
3 files changed, 16 insertions, 16 deletions
diff --git a/clients/cloud-setup/nmcs-provider-azure.c b/clients/cloud-setup/nmcs-provider-azure.c
index 42086b35e1..561eb8175a 100644
--- a/clients/cloud-setup/nmcs-provider-azure.c
+++ b/clients/cloud-setup/nmcs-provider-azure.c
@@ -263,7 +263,7 @@ _get_config_ips_prefix_list_cb(GObject *source, GAsyncResult *result, gpointer u
if (line_len == 0)
continue;
- /* Truncate the string. It's safe to do, because we own @response_data an it has an
+ /* Truncate the string. It's safe to do, because we own @response an it has an
* extra NULL character after the buffer. */
((char *) line)[line_len] = '\0';
@@ -431,7 +431,7 @@ _get_net_ifaces_list_cb(GObject *source, GAsyncResult *result, gpointer user_dat
if (line_len == 0)
continue;
- /* Truncate the string. It's safe to do, because we own @response_data an it has an
+ /* Truncate the string. It's safe to do, because we own @response an it has an
* extra NULL character after the buffer. */
((char *) line)[line_len] = '\0';
diff --git a/clients/cloud-setup/nmcs-provider-ec2.c b/clients/cloud-setup/nmcs-provider-ec2.c
index 40810757de..40bed1575c 100644
--- a/clients/cloud-setup/nmcs-provider-ec2.c
+++ b/clients/cloud-setup/nmcs-provider-ec2.c
@@ -72,11 +72,11 @@ G_DEFINE_TYPE(NMCSProviderEC2, nmcs_provider_ec2, NMCS_TYPE_PROVIDER);
static gboolean
_detect_get_meta_data_check_cb(long response_code,
- GBytes * response_data,
+ GBytes * response,
gpointer check_user_data,
GError **error)
{
- return response_code == 200 && nmcs_utils_parse_get_full_line(response_data, "ami-id");
+ return response_code == 200 && nmcs_utils_parse_get_full_line(response, "ami-id");
}
static void
@@ -187,13 +187,13 @@ _get_config_fetch_done_cb(NMHttpClient *http_client,
gboolean is_local_ipv4)
{
GetConfigIfaceData *iface_data;
- const char * hwaddr = NULL;
- gs_unref_bytes GBytes *response_data = NULL;
- gs_free_error GError *error = NULL;
+ const char * hwaddr = NULL;
+ gs_unref_bytes GBytes *response = NULL;
+ gs_free_error GError *error = NULL;
nm_utils_user_data_unpack(user_data, &iface_data, &hwaddr);
- nm_http_client_poll_get_finish(http_client, result, NULL, &response_data, &error);
+ nm_http_client_poll_get_finish(http_client, result, NULL, &response, &error);
if (!error) {
NMCSProviderGetConfigIfaceData *config_iface_data;
@@ -206,7 +206,7 @@ _get_config_fetch_done_cb(NMHttpClient *http_client,
gs_free const char **s_addrs = NULL;
gsize i, len;
- s_addrs = nm_utils_strsplit_set_full(g_bytes_get_data(response_data, NULL),
+ s_addrs = nm_utils_strsplit_set_full(g_bytes_get_data(response, NULL),
"\n",
NM_UTILS_STRSPLIT_SET_FLAGS_STRSTRIP);
len = NM_PTRARRAY_LEN(s_addrs);
@@ -225,7 +225,7 @@ _get_config_fetch_done_cb(NMHttpClient *http_client,
}
} else {
if (nm_utils_parse_inaddr_prefix_bin(AF_INET,
- g_bytes_get_data(response_data, NULL),
+ g_bytes_get_data(response, NULL),
NULL,
&tmp_addr,
&tmp_prefix)) {
@@ -413,7 +413,7 @@ _get_config_metadata_ready_cb(GObject *source, GAsyncResult *result, gpointer us
static gboolean
_get_config_metadata_ready_check(long response_code,
- GBytes * response_data,
+ GBytes * response,
gpointer check_user_data,
GError **error)
{
@@ -428,12 +428,12 @@ _get_config_metadata_ready_check(long response_code,
const char * c_hwaddr;
gssize iface_idx_counter = 0;
- if (response_code != 200 || !response_data) {
+ if (response_code != 200 || !response) {
/* we wait longer. */
return FALSE;
}
- r_data = g_bytes_get_data(response_data, &r_len);
+ r_data = g_bytes_get_data(response, &r_len);
/* NMHttpClient guarantees that there is a trailing NUL after the data. */
nm_assert(r_data[r_len] == 0);
@@ -444,7 +444,7 @@ _get_config_metadata_ready_check(long response_code,
if (cur_line_len == 0)
continue;
- /* Truncate the string. It's safe to do, because we own @response_data an it has an
+ /* Truncate the string. It's safe to do, because we own @response an it has an
* extra NUL character after the buffer. */
((char *) cur_line)[cur_line_len] = '\0';
diff --git a/clients/cloud-setup/nmcs-provider-gcp.c b/clients/cloud-setup/nmcs-provider-gcp.c
index a0b137aa94..45e1c3622b 100644
--- a/clients/cloud-setup/nmcs-provider-gcp.c
+++ b/clients/cloud-setup/nmcs-provider-gcp.c
@@ -218,7 +218,7 @@ _get_config_ips_list_cb(GObject *source, GAsyncResult *result, gpointer user_dat
while (nm_utils_parse_next_line(&response_str, &response_len, &line, &line_len)) {
gint64 fip_index;
- /* Truncate the string. It's safe to do, because we own @response_data an it has an
+ /* Truncate the string. It's safe to do, because we own @response an it has an
* extra NUL character after the buffer. */
((char *) line)[line_len] = '\0';
@@ -358,7 +358,7 @@ _get_net_ifaces_list_cb(GObject *source, GAsyncResult *result, gpointer user_dat
if (line_len == 0)
continue;
- /* Truncate the string. It's safe to do, because we own @response_data an it has an
+ /* Truncate the string. It's safe to do, because we own @response an it has an
* extra NUL character after the buffer. */
((char *) line)[line_len] = '\0';
if (line[line_len - 1] == '/')