Skip to content

Commit 7034585

Browse files
authored
Changing address (#249)
1 parent 715bab8 commit 7034585

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

instrumentation/otel-webserver-module/src/nginx/ngx_http_opentelemetry_module.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,10 @@ static void fillRequestPayload(request_payload* req_payload, ngx_http_request_t*
16191619
}
16201620

16211621
req_payload->client_ip = (const char*)(r->connection->addr_text).data;
1622+
char *temp_client_ip = ngx_pcalloc(r->pool, (strlen((r->connection->addr_text).data))+1);
1623+
strcpy(temp_client_ip,(const char*)(r->connection->addr_text).data);
1624+
temp_client_ip[(r->connection->addr_text).len]='\0';
1625+
req_payload->client_ip = temp_client_ip;
16221626

16231627
ngx_http_opentelemetry_loc_conf_t *conf =
16241628
ngx_http_get_module_loc_conf(r, ngx_http_opentelemetry_module);

0 commit comments

Comments
 (0)