Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
June 06, 2013 10:06PM
Hello!

On Thu, Jun 06, 2013 at 09:29:36PM -0400, honwel wrote:

> Thanks, i add a line " len = NGX_SOCKADDRLEN ", then , it is ok! thanks
> very much.
> but i want to know , why? (struct sockaddr *) &sa and &len as are input
> paramter, why len need initialized?

As I already said, len value is used as an input parameter by
getsockname() function, and hence it must be initialized properly.

See here for more details:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html

: The address_len argument points to a socklen_t object which on
: input specifies the length of the supplied sockaddr structure, and
: on output specifies the length of the stored address. If the
: actual length of the address is greater than the length of the
: supplied sockaddr structure, the stored address shall be
: truncated.

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

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

How can i get ip and port under forward proxy

honwel June 05, 2013 06:26AM

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

Maxim Dounin June 05, 2013 08:20AM

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

honwel June 05, 2013 09:10PM

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

Maxim Dounin June 06, 2013 09:04AM

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

honwel June 06, 2013 09:29PM

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

Maxim Dounin June 06, 2013 10:06PM

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

honwel June 05, 2013 09:37PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 226
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready