2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Thu, 21 Apr 2005 19:08:07 +0000 (19:08 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Thu, 21 Apr 2005 19:08:07 +0000 (19:08 -0000)
* UnixEndPoint.cs: fix from Mono.Posix.

svn path=/trunk/mcs/; revision=43415

mcs/class/Mono.Posix/Mono.Unix/ChangeLog
mcs/class/Mono.Posix/Mono.Unix/UnixEndPoint.cs

index c4b5d2502c9f1e84e8f857b6cac6dcaa826eea08..35a89142fa2c13da965642ae41f1bf2febb653c9 100644 (file)
@@ -1,3 +1,7 @@
+2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * UnixEndPoint.cs: fix from Mono.Posix.
+
 2005-04-20  Jonathan Pryor <jonpryor@vt.edu>
 
        * Syscall.cs: Make all fork(2) and exec(2) functions `private`.  It
index 4736c1ef0cc8d5609110d8010fa58cd8b5957517..4e3ee10f9c38ee9d11c75bf423d42d43c9ca7994 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Mono.Unix/UnixEndPoint: EndPoint derived class for AF_UNIX family sockets.
+// Mono.Unix.UnixEndPoint: EndPoint derived class for AF_UNIX family sockets.
 //
 // Authors:
 //     Gonzalo Paniagua Javier (gonzalo@ximian.com)
@@ -61,7 +61,18 @@ namespace Mono.Unix
                {
                        int size = socketAddress.Size;
                        byte [] bytes = new byte [size];
-                       for (int i = 0; i < size; i++) {
+                       /*
+                        * Should also check this
+                        *
+                       int addr = (int) AddressFamily.Unix;
+                       if (socketAddress [0] != (addr & 0xFF))
+                               throw new ArgumentException ("socketAddress is not a unix socket address.");
+
+                       if (socketAddress [1] != ((addr & 0xFF00) >> 8))
+                               throw new ArgumentException ("socketAddress is not a unix socket address.");
+                        */
+
+                       for (int i = 2; i < size - 2; i++) {
                                bytes [i] = socketAddress [i];
                        }