Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: How can i get ip and port under forward proxy

$
0
0
Hello!

On Wed, Jun 05, 2013 at 09:10:10PM -0400, honwel wrote:

> Ok, code is as follow:

[...]

> ngx_peer_connection_t *pc;
> u_char sa[NGX_SOCKADDRLEN];
> socklen_t len;
> u_char text[NGX_SOCKADDR_STRLEN];
> u_char *p;
> struct sockaddr_in *sin;

[...]

> if (pc->local_socket) {
> if (getsockname(pc->local_socket, (struct sockaddr *) &sa, &len) !=
> -1) {

At this point, len is uninitialized. It is used by getsockname()
as an input paramter though, and specifies the length of
supplied sockaddr structure.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>