How can i get ip and port under forward proxy
    Maxim Dounin 
    mdounin at mdounin.ru
       
    Fri Jun  7 02:04:42 UTC 2013
    
    
  
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
    
    
More information about the nginx
mailing list