Valgrind reporting issue in connection->addr_text
bhagavathula
nginx-forum at forum.nginx.org
Tue May 7 11:51:41 UTC 2019
Hi,
Thanks for the response. We fixed the issue related to casting and still
didnt see any change in behavior where intermittently garbage values are
being appended.
However, when we tried to get the ip address using alternate means, as
follows the issue is not happening and Valgrind is also not reporting any
issue:
struct sockaddr_in *sin = (struct sockaddr_in *)r->connection->sockaddr;
char *ip = apr_palloc(conf->pool, sizeof(char)*INET_ADDRSTRLEN);
inet_ntop(AF_INET, &(sin->sin_addr), ip, INET_ADDRSTRLEN);
Can you please suggest if there is any issue in earlier approach and using
sockaddr is preferable approach?
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,284065,284075#msg-284075
More information about the nginx
mailing list