2009-05-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Thu, 7 May 2009 18:13:57 +0000 (18:13 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Thu, 7 May 2009 18:13:57 +0000 (18:13 -0000)
* Connection.cs: if the socket is already disconnected, Shutdown will
fail with a SocketException... Also, catch *all* the possible
exceptions since the socket.Close method could also throw
ObjectDisposedException.
Fixes bug #449092.

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

mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog
mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs

index d210f5a51a794e6afa8336905799f43ed11a0b7c..a71ac71851adcefc43e912cb3d6f529f02d884f7 100644 (file)
@@ -1,3 +1,11 @@
+2009-05-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+       * Connection.cs: if the socket is already disconnected, Shutdown will
+       fail with a SocketException... Also, catch *all* the possible
+       exceptions since the socket.Close method could also throw
+       ObjectDisposedException.
+       Fixes bug #449092.
+
 2008-12-20  Jeroen Asselman <jeroen-novel@asselman.com>
 
        * Connection.cs: Apply patch from #436775, there is no need to
index e6c38b4c174c35ce0367c4a25b11d5be40e0dbea..1dc68151233ae9c0697b92225cf0edc86deca44b 100644 (file)
@@ -1150,7 +1150,9 @@ namespace Novell.Directory.Ldap
                                {
                                        if(Ssl)
                                        {
-                                               sock.Shutdown(SocketShutdown.Both);
+                                               try {
+                                                       sock.Shutdown(SocketShutdown.Both);
+                                               } catch {}
                                                sock.Close();
                                        }
                                        else
@@ -1160,7 +1162,7 @@ namespace Novell.Directory.Ldap
                                                socket.Close();
                                        }
                                }
-                               catch (System.IO.IOException ie)
+                               catch (Exception)
                                {
                                        // ignore problem closing socket
                                }