[Pkg-mono-svn-commits] rev 2328 - in mono/trunk/debian: . patches

Sebastian Dröge slomo-guest at costa.debian.org
Sun Mar 12 15:13:06 UTC 2006


Author: slomo-guest
Date: 2006-03-12 15:13:05 +0000 (Sun, 12 Mar 2006)
New Revision: 2328

Added:
   mono/trunk/debian/patches/unix-end-point-equals.dpatch
Modified:
   mono/trunk/debian/changelog
   mono/trunk/debian/patches/00list
Log:
* mono/debian/patches/unix-end-point-equals.dpatch (SVN rev 57754:57757):
  + Fix Equals() and GetHashCode() of Mono.Unix.UnixEndPoint.
    http://bugzilla.ximian.com/show_bug.cgi?id=77747
	    


Modified: mono/trunk/debian/changelog
===================================================================
--- mono/trunk/debian/changelog	2006-03-12 12:23:15 UTC (rev 2327)
+++ mono/trunk/debian/changelog	2006-03-12 15:13:05 UTC (rev 2328)
@@ -1,3 +1,11 @@
+mono (1.1.13.4-2) unstable; urgency=low
+
+  * debian/patches/unix-end-point-equals.dpatch (SVN rev 57754:57757):
+    + Fix Equals() and GetHashCode() of Mono.Unix.UnixEndPoint.
+      http://bugzilla.ximian.com/show_bug.cgi?id=77747
+
+ -- Sebastian Dröge <slomo at ubuntu.com>  Sun, 12 Mar 2006 16:11:47 +0100
+
 mono (1.1.13.4-1) unstable; urgency=low
 
   * New upstream release

Modified: mono/trunk/debian/patches/00list
===================================================================
--- mono/trunk/debian/patches/00list	2006-03-12 12:23:15 UTC (rev 2327)
+++ mono/trunk/debian/patches/00list	2006-03-12 15:13:05 UTC (rev 2328)
@@ -1,2 +1,3 @@
 remove_broken_dllmap_from_mono-shlib-cop.dpatch
 unix-end-point-serialize.dpatch
+unix-end-point-equals.dpatch

Added: mono/trunk/debian/patches/unix-end-point-equals.dpatch
===================================================================
--- mono/trunk/debian/patches/unix-end-point-equals.dpatch	2006-03-12 12:23:15 UTC (rev 2327)
+++ mono/trunk/debian/patches/unix-end-point-equals.dpatch	2006-03-12 15:13:05 UTC (rev 2328)
@@ -0,0 +1,137 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+
+ at DPATCH@
+
+Index: mcs/class/Mono.Posix/Mono.Unix/UnixEndPoint.cs
+===================================================================
+--- mcs/class/Mono.Posix/Mono.Unix/UnixEndPoint.cs	(revision 57753)
++++ mcs/class/Mono.Posix/Mono.Unix/UnixEndPoint.cs	(revision 57754)
+@@ -41,6 +41,11 @@
+ 		
+ 		public UnixEndPoint (string filename)
+ 		{
++			if (filename == null)
++				throw new ArgumentNullException ("filename");
++
++			if (filename == "")
++				throw new ArgumentException ("Cannot be empty.", "filename");
+ 			this.filename = filename;
+ 		}
+ 		
+@@ -93,6 +98,20 @@
+ 		public override string ToString() {
+ 			return(filename);
+ 		}
++
++		public override int GetHashCode ()
++		{
++			return filename.GetHashCode ();
++		}
++
++		public override bool Equals (object o)
++		{
++			UnixEndPoint other = o as UnixEndPoint;
++			if (other == null)
++				return false;
++
++			return (other.filename == filename);
++		}
+ 	}
+ }
+ 
+Index: mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs
+===================================================================
+--- mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs	(revision 57754)
++++ mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs	(revision 57755)
+@@ -42,6 +42,11 @@
+ 		
+ 		public UnixEndPoint (string filename)
+ 		{
++			if (filename == null)
++				throw new ArgumentNullException ("filename");
++
++			if (filename == "")
++				throw new ArgumentException ("Cannot be empty.", "filename");
+ 			this.filename = filename;
+ 		}
+ 		
+@@ -60,8 +65,6 @@
+ 
+ 		public override EndPoint Create (SocketAddress socketAddress)
+ 		{
+-			int size = socketAddress.Size;
+-			byte [] bytes = new byte [size];
+ 			/*
+ 			 * Should also check this
+ 			 *
+@@ -73,8 +76,9 @@
+ 				throw new ArgumentException ("socketAddress is not a unix socket address.");
+ 			 */
+ 
+-			for (int i = 2; i < size - 2; i++) {
+-				bytes [i] = socketAddress [i];
++			byte [] bytes = new byte [socketAddress.Size - 2];
++			for (int i = 0; i < bytes.Length; i++) {
++				bytes [i] = socketAddress [i + 2];
+ 			}
+ 
+ 			string name = Encoding.Default.GetString (bytes);
+@@ -95,6 +99,20 @@
+ 		public override string ToString() {
+ 			return(filename);
+ 		}
++
++		public override int GetHashCode ()
++		{
++			return filename.GetHashCode ();
++		}
++
++		public override bool Equals (object o)
++		{
++			UnixEndPoint other = o as UnixEndPoint;
++			if (other == null)
++				return false;
++
++			return (other.filename == filename);
++		}
+ 	}
+ }
+ 
+Index: mono/metadata/socket-io.c
+===================================================================
+--- mono/metadata/socket-io.c	(revision 57755)
++++ mono/metadata/socket-io.c	(revision 57756)
+@@ -823,7 +823,19 @@
+ 	field=mono_class_get_field_from_name(sockaddr_class, "data");
+ 
+ 	/* Make sure there is space for the family and size bytes */
+-	data=mono_array_new(domain, mono_get_byte_class (), sa_size+2);
++#ifdef HAVE_SYS_UN_H
++	if (saddr->sa_family == AF_UNIX) {
++		/* sa_len includes the entire sockaddr size, so we don't need the
++		 * N bytes (sizeof (unsigned short)) of the family. */
++		data=mono_array_new(domain, mono_get_byte_class (), sa_size - 2);
++	} else
++#endif
++	{
++		/* May be the +2 here is too conservative, as sa_len returns
++		 * the length of the entire sockaddr_in/in6, including
++		 * sizeof (unsigned short) of the family */
++		data=mono_array_new(domain, mono_get_byte_class (), sa_size+2);
++	}
+ 
+ 	/* The data buffer is laid out as follows:
+ 	 * bytes 0 and 1 are the address family
+Index: mcs/class/System/System.Net.Sockets/Socket.cs
+===================================================================
+--- mcs/class/System/System.Net.Sockets/Socket.cs	(revision 57756)
++++ mcs/class/System/System.Net.Sockets/Socket.cs	(revision 57757)
+@@ -508,7 +508,7 @@
+ 			ConstructorInfo cons=unixendpointtype.GetConstructor(arg_types);
+ 
+ 			object[] args=new object[1];
+-			args[0]="";
++			args[0]="nothing";
+ 
+ 			unixendpoint=cons.Invoke(args);
+ 		}


Property changes on: mono/trunk/debian/patches/unix-end-point-equals.dpatch
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-mono-svn-commits mailing list