Skip to content

Commit

Permalink
out_bigquery: enable 'ipv6 mode' support (#761)
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Jul 19, 2019
1 parent 64c223e commit 6f497b8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions plugins/out_bigquery/bigquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ static int cb_bigquery_init(struct flb_output_instance *ins,
struct flb_config *config, void *data)
{
char *token;
int io_flags = FLB_IO_TLS;
struct flb_bigquery *ctx;

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

flb_output_set_context(ins, ctx);

/* Create upstream context for BigQuery Streaming Inserts (no oauth2 service) */
ctx->u = flb_upstream_create_url(config, FLB_BIGQUERY_URL_BASE, FLB_IO_TLS, &ins->tls);
/* Network mode IPv6 */
if (ins->host.ipv6 == FLB_TRUE) {
io_flags |= FLB_IO_IPV6;
}

/*
* Create upstream context for BigQuery Streaming Inserts
* (no oauth2 service)
*/
ctx->u = flb_upstream_create_url(config, FLB_BIGQUERY_URL_BASE,
io_flags, &ins->tls);
if (!ctx->u) {
flb_error("[out_bigquery] upstream creation failed");
return -1;
Expand Down

0 comments on commit 6f497b8

Please sign in to comment.