out_stackdriver: gce: fix code style
static int fetch_metadata(struct flb_upstream *ctx, char *uri,
- char *payload) {
+ char *payload)
+{
int ret;
int ret_code;
size_t b_sent;
@@ -87,10 +88,12 @@ static int fetch_metadata(struct flb_upstream *ctx, char *uri,
/* Cleanup */
flb_http_client_destroy(c);
flb_upstream_conn_release(metadata_conn);
+
return ret_code;
}
-int gce_metadata_read_token(struct flb_stackdriver *ctx) {
+int gce_metadata_read_token(struct flb_stackdriver *ctx)
+{
int ret;
flb_sds_t uri = flb_sds_create(FLB_STD_METADATA_SERVICE_ACCOUNT_URI);
flb_sds_t payload = flb_sds_create_size(4096);
@@ -117,7 +120,8 @@ int gce_metadata_read_token(struct flb_stackdriver *ctx) {
return 0;
}
-int gce_metadata_read_zone(struct flb_stackdriver *ctx) {
+int gce_metadata_read_zone(struct flb_stackdriver *ctx)
+{
int ret;
int i;
int j;
@@ -142,11 +146,13 @@ int gce_metadata_read_zone(struct flb_stackdriver *ctx) {
break;
}
}
+
if (part != 3) {
flb_error("[out_stackdriver] wrong format of zone response");
flb_sds_destroy(payload);
return -1;
}
+
zone = flb_sds_create_size(flb_sds_len(payload) - i);
j = 0;
while (i != flb_sds_len(payload)) {
@@ -157,10 +163,12 @@ int gce_metadata_read_zone(struct flb_stackdriver *ctx) {
ctx->zone = flb_sds_create(zone);
flb_sds_destroy(zone);
flb_sds_destroy(payload);
+
return 0;
}
-int gce_metadata_read_project_id(struct flb_stackdriver *ctx) {
+int gce_metadata_read_project_id(struct flb_stackdriver *ctx)
+{
int ret;
flb_sds_t payload = flb_sds_create_size(4096);
@@ -175,7 +183,8 @@ int gce_metadata_read_project_id(struct flb_stackdriver *ctx) {
return 0;
}
-int gce_metadata_read_instance_id(struct flb_stackdriver *ctx) {
+int gce_metadata_read_instance_id(struct flb_stackdriver *ctx)
+{
int ret;
flb_sds_t payload = flb_sds_create_size(4096);
