diff options
author | Palaniappan N <npalani@mono-cvs.ximian.com> | 2007-12-19 14:22:57 +0300 |
---|---|---|
committer | Palaniappan N <npalani@mono-cvs.ximian.com> | 2007-12-19 14:22:57 +0300 |
commit | 2769b21ca5ca62df54f9234c39b778f7849e1280 (patch) | |
tree | c289f5f6fbcae3676b73e8d9c6856ebd83f4ee5b /mcs/class/Novell.Directory.Ldap | |
parent | 7bf596d7ca36d247c8c41863bdf985685faceb97 (diff) |
Fix for the issue of getting occasional -5875 error on the server when
disconnecting the client
svn path=/trunk/mcs/; revision=91610
Diffstat (limited to 'mcs/class/Novell.Directory.Ldap')
-rw-r--r-- | mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs index 908bd854660..01784a43bc1 100644 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs +++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs @@ -961,20 +961,21 @@ namespace Novell.Directory.Ldap } if(Connected == true) { - LdapMessage msg = info.Request; - writeMessage(msg); - return ; + LdapMessage msg = info.Request; + writeMessage(msg); + return ; } else { - int errorCount=0; - for(errorCount=0;errorCount<contents.Length;errorCount++) - if(contents[errorCount][0] == "CONNECTION_CLOSED") + int errorcount=0; + for(errorcount=0;errorcount<contents.Length;errorcount++) + if(contents[errorcount][0]=="CONNECTION_CLOSED") break; - throw new LdapException(ExceptionMessages.CONNECTION_CLOSED, new System.Object[]{host, port}, LdapException.CONNECT_ERROR, (String)contents[errorCount][1]); + throw new LdapException(ExceptionMessages.CONNECTION_CLOSED, new System.Object[]{host, port}, LdapException.CONNECT_ERROR, (String)contents[errorcount][1]); } } + /// <summary> Writes an LdapMessage to the Ldap server over a socket. /// /// </summary> @@ -1130,7 +1131,7 @@ namespace Novell.Directory.Ldap sbyte[] ber = msg.Asn1Object.getEncoding(encoder); out_Renamed.Write(SupportClass.ToByteArray(ber), 0, ber.Length); out_Renamed.Flush(); - + out_Renamed.Close(); } catch (System.Exception ex) { |