Date: 09/23/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6833 Updated: mcrypt 2.4.4 compilation fails"
- Previous message: frederi <email protected>: "[PHP-DEV] Bug #6855: the urldecoding of ' doesn't work"
- In reply to: Sascha Schumann: "[PHP-DEV] Re: getsockname() semantics"
- Reply: Sascha Schumann: "[PHP-DEV] Re: getsockname() semantics"
- Maybe reply: Sascha Schumann: "[PHP-DEV] Re: getsockname() semantics"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Sep 23, 2000 at 09:14:50PM +0200, Sascha Schumann wrote:
> This reminds me of some ugliness in the sockets' extension
> code.
Yes, there are some other ugly stuff there too.
> The code uses getsockname() to determine the address family
> of the socket. It passes a pointer to a sockaddr structure to
It checks the family to determine if it's AF_INET or AF_UNIX.
If I on FreeBSD, Digital Unix or IRIX create an AF_UNIX socket
and immediately call getsockname, I don't get AF_UNIX as the
family.
I think we might need to store the type internally when the socket
is created.
> getsockname() under the assumption that the sockaddr
> structure is large enough to accommodate all supported
> protocol-specific address structures. This assumption is
> false.
If we store it internally, we can avoid getsockname().
> The right way to do this is to use the sockaddr_storage
> structure. If that structure is not available, fall back to
> the sockaddr structure for compatibility with existing
> implementations.
What about falling back to sockaddr_un?
Stig
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6833 Updated: mcrypt 2.4.4 compilation fails"
- Previous message: frederi <email protected>: "[PHP-DEV] Bug #6855: the urldecoding of ' doesn't work"
- In reply to: Sascha Schumann: "[PHP-DEV] Re: getsockname() semantics"
- Reply: Sascha Schumann: "[PHP-DEV] Re: getsockname() semantics"
- Maybe reply: Sascha Schumann: "[PHP-DEV] Re: getsockname() semantics"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

