For an IPv6, sizeof (struct sockaddr_in6) is only 28bytes, so why set
NGX_SOCKADDRLEN 512?
Posted at Nginx Forum:
For an IPv6, sizeof (struct sockaddr_in6) is only 28bytes, so why set
NGX_SOCKADDRLEN 512?
Posted at Nginx Forum:
On Mar 1, 2011, at 10:28 , speedfirst wrote:
For an IPv6, sizeof (struct sockaddr_in6) is only 28bytes, so why set
NGX_SOCKADDRLEN 512?
src/core/ngx_inet.h
/*
sizeof(struct sockaddr_storage)
sizeof(struct sockaddr_un)
sizeof(struct sockaddr_in6)
sizeof(struct sockaddr_in)
*/
[…]
#if (NGX_HAVE_UNIX_DOMAIN)
#define NGX_SOCKADDRLEN sizeof(struct sockaddr_un)
#else
#define NGX_SOCKADDRLEN 512
#endif
struct sockaddr_un size is about 110 bytes depending on platform.
–
Igor S.
http://sysoev.ru/en/
On Mar 1, 2011, at 11:59 , speedfirst wrote:
I think this way would be better:
#if (NGX_HAVE_UNIX_DOMAIN)
#define NGX_SOCKADDRLEN sizeof(struct sockaddr_un)
#else
#define NGX_SOCKADDRLEN sizeof(struct sockaddr_storage)
#endifsizeof(sturct sockaddr_storage) is 128 in my Linux 64bit, 512 is too
big.
The problem that struct sockaddr_storage is relatively recent thing.
–
Igor S.
http://sysoev.ru/en/
I think this way would be better:
#if (NGX_HAVE_UNIX_DOMAIN)
#define NGX_SOCKADDRLEN sizeof(struct sockaddr_un)
#else
#define NGX_SOCKADDRLEN sizeof(struct sockaddr_storage)
#endif
sizeof(sturct sockaddr_storage) is 128 in my Linux 64bit, 512 is too
big.
anyway, this is not critical.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs