Edit report at https://bugs.php.net/bug.php?id=60106&edit=1

 ID:                 60106
 Updated by:         larue...@php.net
 Reported by:        tyr...@php.net
 Summary:            stream_socket_server + long unix socket path =
                     'Unknown error'
 Status:             Open
 Type:               Bug
 Package:            Streams related
 Operating System:   linux debian squeeze 64 bit
 PHP Version:        5.4.0beta2
 Block user comment: N
 Private report:     N

 New Comment:

the limition is in socket self, not php, yes PHP can increase the limition, but 
I 
am afraid it dosen't work too.

but maybe we can throw warning when truncation occurring.


Previous Comments:
------------------------------------------------------------------------
[2011-10-21 08:21:38] tyr...@php.net

I'm fine with the idea to mark this as a documentation problem, but maybe we 
should  change the length limit to something more common, like 127 or 255.
what do you think?

------------------------------------------------------------------------
[2011-10-21 03:51:13] larue...@php.net

actullay, there is a limition, 

sys/un.h 

/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket.  */
struct sockaddr_un
  {
    __SOCKADDR_COMMON (sun_);
    char sun_path[108];     /* Path name.  */
  };


I think this issue could mark as doc problem.

------------------------------------------------------------------------
[2011-10-20 19:11:44] tyr...@php.net

Description:
------------
this works:
./sapi/cli/php -r '$file = "/tmp/".str_repeat("a", 
101);stream_socket_server("unix://".$file) && unlink($file);'

this isn't:
./sapi/cli/php -r '$file = "/tmp/".str_repeat("a", 
102);stream_socket_server("unix://".$file) && unlink($file);'

gives me an:

Warning: stream_socket_server(): unable to connect to 
unix:///tmp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (Unknown error) in Command line code on line 
1

I didn't found any mention in the documentation about restrictions on the 
length 
of the socket file.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60106&edit=1

Reply via email to