Skip to content

Commit

Permalink
Do not try to send metrics to default port.
Browse files Browse the repository at this point in the history
Always need to specify a port
  • Loading branch information
Egor Redozubov committed Mar 21, 2024
1 parent 3bde54d commit bd8b484
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ngx_http_statsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,14 @@ ngx_http_statsd_set_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}

int statsd_port_override = STATSD_DEFAULT_PORT;
if (value[2].len >= 0) {
statsd_port_override = ngx_atoi(value[2].data, value[2].len);
if (value[2].len <= 0) {
statsd_port_override = STATSD_DEFAULT_PORT;
}
else if (ngx_strcmp(value[2].data, "default") == 0) {
statsd_port_override = STATSD_DEFAULT_PORT;
}
else {
statsd_port_override = STATSD_DEFAULT_PORT;
statsd_port_override = ngx_atoi(value[2].data, value[2].len);
}

ngx_log_debug1(NGX_LOG_DEBUG_HTTP, cf->log, 0,
Expand Down

0 comments on commit bd8b484

Please sign in to comment.