Skip to content

Commit 466191c

Browse files
committed
out_bigquery: enable 'ipv6 mode' support (fluent#761)
Signed-off-by: Eduardo Silva <[email protected]>
1 parent d0887a8 commit 466191c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

plugins/out_bigquery/bigquery.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ static int cb_bigquery_init(struct flb_output_instance *ins,
283283
struct flb_config *config, void *data)
284284
{
285285
char *token;
286+
int io_flags = FLB_IO_TLS;
286287
struct flb_bigquery *ctx;
287288

288289
/* Create config context */
@@ -294,8 +295,17 @@ static int cb_bigquery_init(struct flb_output_instance *ins,
294295

295296
flb_output_set_context(ins, ctx);
296297

297-
/* Create upstream context for BigQuery Streaming Inserts (no oauth2 service) */
298-
ctx->u = flb_upstream_create_url(config, FLB_BIGQUERY_URL_BASE, FLB_IO_TLS, &ins->tls);
298+
/* Network mode IPv6 */
299+
if (ins->host.ipv6 == FLB_TRUE) {
300+
io_flags |= FLB_IO_IPV6;
301+
}
302+
303+
/*
304+
* Create upstream context for BigQuery Streaming Inserts
305+
* (no oauth2 service)
306+
*/
307+
ctx->u = flb_upstream_create_url(config, FLB_BIGQUERY_URL_BASE,
308+
io_flags, &ins->tls);
299309
if (!ctx->u) {
300310
flb_error("[out_bigquery] upstream creation failed");
301311
return -1;

0 commit comments

Comments
 (0)