[pgsqlclient-checkins] pgsqlclient_10/source/PostgreSql/Data/Protocol PgCharSet.cs,1.2,1.3 PgCharSet
Status: Inactive
Brought to you by:
carlosga_fb
From: Carlos G. Á. <car...@us...> - 2005-09-11 13:29:27
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26088/Data/Protocol Modified Files: PgCharSet.cs PgCharSetCollection.cs PgClientMessageEventArgs.cs PgClientNotificationEventArgs.cs PgDbClient.cs PgOutputPacket.cs PgParameter.cs PgResponsePacket.cs PgStatement.cs PgType.cs Log Message: Updated sources Index: PgResponsePacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgResponsePacket.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgResponsePacket.cs 11 Sep 2005 12:12:31 -0000 1.3 --- PgResponsePacket.cs 11 Sep 2005 13:29:16 -0000 1.4 *************** *** 283,287 **** // Read array element type ! PgType elementType = PgDbClient.Types[this.ReadInt32()]; // Read array lengths and lower bounds --- 283,287 ---- // Read array element type ! PgType elementType = PgDbClient.DataTypes[this.ReadInt32()]; // Read array lengths and lower bounds *************** *** 306,310 **** public Array ReadVector(PgType type, int length) { ! PgType elementType = PgDbClient.Types[type.ElementType]; Array data = null; --- 306,310 ---- public Array ReadVector(PgType type, int length) { ! PgType elementType = PgDbClient.DataTypes[type.ElementType]; Array data = null; *************** *** 592,596 **** private Array ReadStringArray(PgType type, int length) { ! PgType elementType = PgDbClient.Types[type.ElementType]; Array data = null; --- 592,596 ---- private Array ReadStringArray(PgType type, int length) { ! PgType elementType = PgDbClient.DataTypes[type.ElementType]; Array data = null; Index: PgType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgType.cs 11 Sep 2005 12:12:31 -0000 1.2 --- PgType.cs 11 Sep 2005 13:29:16 -0000 1.3 *************** *** 63,69 **** int type = elementType; ! while (PgDbClient.Types[type].DataType == PgDataType.Array) { ! type = PgDbClient.Types[type].ElementType; } --- 63,69 ---- int type = elementType; ! while (PgDbClient.DataTypes[type].DataType == PgDataType.Array) { ! type = PgDbClient.DataTypes[type].ElementType; } Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgDbClient.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgDbClient.cs 11 Sep 2005 12:12:31 -0000 1.3 --- PgDbClient.cs 11 Sep 2005 13:29:16 -0000 1.4 *************** *** 29,52 **** internal class PgDbClient { - #region · Static Fields · - - private static PgTypeCollection types; - private static PgCharSetCollection charSets; - - #endregion - #region · Static Properties · ! public static PgTypeCollection Types ! { ! get { return types; } ! set { types = value; } ! } ! ! public static PgCharSetCollection CharSets ! { ! get { return charSets; } ! set { charSets = value; } ! } #endregion --- 29,36 ---- internal class PgDbClient { #region · Static Properties · ! public static readonly PgTypeCollection DataTypes = new PgTypeCollection(); ! public static readonly PgCharactersetCollection Charactersets = new PgCharactersetCollection(); #endregion *************** *** 56,167 **** public static void InitializeTypes() { ! if (types != null) ! { ! return; ! } ! ! types = new PgTypeCollection(); ! ! types.Add(16 , "bool" , PgDataType.Boolean , 0, PgTypeFormat.Binary, 1); ! types.Add(17 , "bytea" , PgDataType.Binary , 0, PgTypeFormat.Binary, 0); ! types.Add(18 , "char" , PgDataType.Char , 0, PgTypeFormat.Text, 0); ! types.Add(19 , "name" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! types.Add(20 , "int8" , PgDataType.Int8 , 0, PgTypeFormat.Binary, 8); ! types.Add(21 , "int2" , PgDataType.Int2 , 0, PgTypeFormat.Binary, 2); ! types.Add(22 , "int2vector" , PgDataType.Vector , 21, PgTypeFormat.Binary, 2); ! types.Add(23 , "int4" , PgDataType.Int4 , 0, PgTypeFormat.Binary, 4); ! types.Add(24 , "regproc" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! types.Add(25 , "text" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! types.Add(26 , "oid" , PgDataType.Int4 , 0, PgTypeFormat.Binary, 4); ! types.Add(30 , "oidvector" , PgDataType.Vector , 26, PgTypeFormat.Binary, 4); ! types.Add(600 , "point" , PgDataType.Point , 701, PgTypeFormat.Binary, 16); ! types.Add(601 , "lseg" , PgDataType.LSeg , 600, PgTypeFormat.Binary, 32); ! types.Add(602 , "path" , PgDataType.Path , 0, PgTypeFormat.Binary, 16); ! types.Add(603 , "box" , PgDataType.Box , 600, PgTypeFormat.Binary, 32); ! types.Add(604 , "polygon" , PgDataType.Polygon , 0, PgTypeFormat.Binary, 16); ! types.Add(628 , "line" , PgDataType.Line , 701, PgTypeFormat.Binary, 32); ! types.Add(629 , "_line" , PgDataType.Array , 628, PgTypeFormat.Binary, 32); ! types.Add(718 , "circle" , PgDataType.Circle , 0, PgTypeFormat.Binary, 24); ! types.Add(719 , "_circle" , PgDataType.Array , 718, PgTypeFormat.Binary, 24); ! types.Add(700 , "float4" , PgDataType.Float , 0, PgTypeFormat.Binary, 4); ! types.Add(701 , "float8" , PgDataType.Double , 0, PgTypeFormat.Binary, 8); ! types.Add(705 , "unknown" , PgDataType.Binary , 0, PgTypeFormat.Binary, 0); ! types.Add(790 , "money" , PgDataType.Currency , 0, PgTypeFormat.Binary, 4); ! types.Add(829 , "macaddr" , PgDataType.VarChar , 0, PgTypeFormat.Text, 6); ! types.Add(869 , "inet" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! types.Add(1000 , "_bool" , PgDataType.Array , 16, PgTypeFormat.Binary, 1); ! types.Add(1005 , "_int2" , PgDataType.Array , 21, PgTypeFormat.Binary, 2); ! types.Add(1007 , "_int4" , PgDataType.Array , 23, PgTypeFormat.Binary, 4); ! types.Add(1009 , "_text" , PgDataType.Array , 25, PgTypeFormat.Binary, 0); ! types.Add(1016 , "_int8" , PgDataType.Array , 20, PgTypeFormat.Binary, 8); ! types.Add(1017 , "_point" , PgDataType.Array , 600, PgTypeFormat.Binary, 16); ! types.Add(1018 , "_lseg" , PgDataType.Array , 601, PgTypeFormat.Binary, 32); ! types.Add(1019 , "_path" , PgDataType.Array , 602, PgTypeFormat.Binary, -1); ! types.Add(1020 , "_box" , PgDataType.Array , 603, PgTypeFormat.Binary, 32); ! types.Add(1021 , "_float4" , PgDataType.Array , 700, PgTypeFormat.Binary, 4); ! types.Add(1027 , "_polygon" , PgDataType.Array , 604, PgTypeFormat.Binary, 16); ! types.Add(1033 , "aclitem" , PgDataType.VarChar , 0, PgTypeFormat.Text, 12); ! types.Add(1034 , "_aclitem" , PgDataType.Array , 1033, PgTypeFormat.Text, 0); ! types.Add(1042 , "bpchar" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! types.Add(1043 , "varchar" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! types.Add(1082 , "date" , PgDataType.Date , 0, PgTypeFormat.Binary, 4); ! types.Add(1083 , "time" , PgDataType.Time , 0, PgTypeFormat.Text, 8); ! types.Add(1114 , "timestamp" , PgDataType.Timestamp , 0, PgTypeFormat.Text, 8); ! types.Add(1184 , "timestamptz" , PgDataType.TimestampWithTZ, 0, PgTypeFormat.Binary, 8); ! types.Add(1186 , "interval" , PgDataType.Interval , 0, PgTypeFormat.Binary, 12); ! types.Add(1266 , "timetz" , PgDataType.TimeWithTZ , 0, PgTypeFormat.Binary, 12); ! types.Add(1560 , "bit" , PgDataType.Byte , 0, PgTypeFormat.Text, 1); ! types.Add(1562 , "varbit" , PgDataType.Byte , 0, PgTypeFormat.Binary, 0); ! types.Add(1700 , "numeric" , PgDataType.Decimal , 0, PgTypeFormat.Text, 8); ! types.Add(1790 , "refcursor" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! types.Add(2277 , "anyarray" , PgDataType.Array , 0, PgTypeFormat.Binary, 8); } public static void InitializeCharSets() { ! if (charSets != null) ! { ! return; ! } ! ! charSets = new PgCharSetCollection(); ! ! PgDbClient.addCharset("SQL_ASCII" , "ascii"); // ASCII ! PgDbClient.addCharset("EUC_JP" , "euc-jp"); // Japanese EUC ! PgDbClient.addCharset("EUC_CN" , "euc-cn"); // Chinese EUC ! PgDbClient.addCharset("UNICODE" , "UTF-8"); // Unicode (UTF-8) ! PgDbClient.addCharset("LATIN1" , "iso-8859-1"); // ISO 8859-1/ECMA 94 (Latin alphabet no.1) ! PgDbClient.addCharset("LATIN2" , "iso-8859-2"); // ISO 8859-2/ECMA 94 (Latin alphabet no.2) ! PgDbClient.addCharset("LATIN4" , 1257); // ISO 8859-4/ECMA 94 (Latin alphabet no.4) ! PgDbClient.addCharset("ISO_8859_7" , 1253); // ISO 8859-7/ECMA 118 (Latin/Greek) ! PgDbClient.addCharset("LATIN9" , "iso-8859-15"); // ISO 8859-15 (Latin alphabet no.9) ! PgDbClient.addCharset("KOI8" , "koi8-r"); // KOI8-R(U) ! PgDbClient.addCharset("WIN" , "windows-1251"); // Windows CP1251 ! PgDbClient.addCharset("WIN1256" , "windows-1256"); // Windows CP1256 (Arabic) ! PgDbClient.addCharset("WIN1256" , "windows-1256"); // Windows CP1256 (Arabic) ! PgDbClient.addCharset("WIN1256" , "windows-1258"); // TCVN-5712/Windows CP1258 (Vietnamese) ! PgDbClient.addCharset("WIN1256" , "windows-874"); // Windows CP874 (Thai) ! } ! ! private static void addCharset(string charset, string systemCharset) ! { ! try ! { ! charSets.Add(charset, systemCharset); ! } ! catch (Exception) ! { ! } ! } ! ! private static void addCharset(string charset, int cp) ! { ! try ! { ! charSets.Add(charset, cp); ! } ! catch (Exception) ! { ! } } --- 40,115 ---- public static void InitializeTypes() { ! DataTypes.Add(16 , "bool" , PgDataType.Boolean , 0, PgTypeFormat.Binary, 1); ! DataTypes.Add(17 , "bytea" , PgDataType.Binary , 0, PgTypeFormat.Binary, 0); ! DataTypes.Add(18 , "char" , PgDataType.Char , 0, PgTypeFormat.Text, 0); ! DataTypes.Add(19 , "name" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! DataTypes.Add(20 , "int8" , PgDataType.Int8 , 0, PgTypeFormat.Binary, 8); ! DataTypes.Add(21 , "int2" , PgDataType.Int2 , 0, PgTypeFormat.Binary, 2); ! DataTypes.Add(22 , "int2vector" , PgDataType.Vector , 21, PgTypeFormat.Binary, 2); ! DataTypes.Add(23 , "int4" , PgDataType.Int4 , 0, PgTypeFormat.Binary, 4); ! DataTypes.Add(24 , "regproc" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! DataTypes.Add(25 , "text" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! DataTypes.Add(26 , "oid" , PgDataType.Int4 , 0, PgTypeFormat.Binary, 4); ! DataTypes.Add(30 , "oidvector" , PgDataType.Vector , 26, PgTypeFormat.Binary, 4); ! DataTypes.Add(600 , "point" , PgDataType.Point , 701, PgTypeFormat.Binary, 16); ! DataTypes.Add(601 , "lseg" , PgDataType.LSeg , 600, PgTypeFormat.Binary, 32); ! DataTypes.Add(602 , "path" , PgDataType.Path , 0, PgTypeFormat.Binary, 16); ! DataTypes.Add(603 , "box" , PgDataType.Box , 600, PgTypeFormat.Binary, 32); ! DataTypes.Add(604 , "polygon" , PgDataType.Polygon , 0, PgTypeFormat.Binary, 16); ! DataTypes.Add(628 , "line" , PgDataType.Line , 701, PgTypeFormat.Binary, 32); ! DataTypes.Add(629 , "_line" , PgDataType.Array , 628, PgTypeFormat.Binary, 32); ! DataTypes.Add(718 , "circle" , PgDataType.Circle , 0, PgTypeFormat.Binary, 24); ! DataTypes.Add(719 , "_circle" , PgDataType.Array , 718, PgTypeFormat.Binary, 24); ! DataTypes.Add(700 , "float4" , PgDataType.Float , 0, PgTypeFormat.Binary, 4); ! DataTypes.Add(701 , "float8" , PgDataType.Double , 0, PgTypeFormat.Binary, 8); ! DataTypes.Add(705 , "unknown" , PgDataType.Binary , 0, PgTypeFormat.Binary, 0); ! DataTypes.Add(790 , "money" , PgDataType.Currency , 0, PgTypeFormat.Binary, 4); ! DataTypes.Add(829 , "macaddr" , PgDataType.VarChar , 0, PgTypeFormat.Text, 6); ! DataTypes.Add(869 , "inet" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! DataTypes.Add(1000 , "_bool" , PgDataType.Array , 16, PgTypeFormat.Binary, 1); ! DataTypes.Add(1005 , "_int2" , PgDataType.Array , 21, PgTypeFormat.Binary, 2); ! DataTypes.Add(1007 , "_int4" , PgDataType.Array , 23, PgTypeFormat.Binary, 4); ! DataTypes.Add(1009 , "_text" , PgDataType.Array , 25, PgTypeFormat.Binary, 0); ! DataTypes.Add(1016 , "_int8" , PgDataType.Array , 20, PgTypeFormat.Binary, 8); ! DataTypes.Add(1017 , "_point" , PgDataType.Array , 600, PgTypeFormat.Binary, 16); ! DataTypes.Add(1018 , "_lseg" , PgDataType.Array , 601, PgTypeFormat.Binary, 32); ! DataTypes.Add(1019 , "_path" , PgDataType.Array , 602, PgTypeFormat.Binary, -1); ! DataTypes.Add(1020 , "_box" , PgDataType.Array , 603, PgTypeFormat.Binary, 32); ! DataTypes.Add(1021 , "_float4" , PgDataType.Array , 700, PgTypeFormat.Binary, 4); ! DataTypes.Add(1027 , "_polygon" , PgDataType.Array , 604, PgTypeFormat.Binary, 16); ! DataTypes.Add(1033 , "aclitem" , PgDataType.VarChar , 0, PgTypeFormat.Text, 12); ! DataTypes.Add(1034 , "_aclitem" , PgDataType.Array , 1033, PgTypeFormat.Text, 0); ! DataTypes.Add(1042 , "bpchar" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! DataTypes.Add(1043 , "varchar" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! DataTypes.Add(1082 , "date" , PgDataType.Date , 0, PgTypeFormat.Binary, 4); ! DataTypes.Add(1083 , "time" , PgDataType.Time , 0, PgTypeFormat.Text, 8); ! DataTypes.Add(1114 , "timestamp" , PgDataType.Timestamp , 0, PgTypeFormat.Text, 8); ! DataTypes.Add(1184 , "timestamptz" , PgDataType.TimestampWithTZ, 0, PgTypeFormat.Binary, 8); ! DataTypes.Add(1186 , "interval" , PgDataType.Interval , 0, PgTypeFormat.Binary, 12); ! DataTypes.Add(1266 , "timetz" , PgDataType.TimeWithTZ , 0, PgTypeFormat.Binary, 12); ! DataTypes.Add(1560 , "bit" , PgDataType.Byte , 0, PgTypeFormat.Text, 1); ! DataTypes.Add(1562 , "varbit" , PgDataType.Byte , 0, PgTypeFormat.Binary, 0); ! DataTypes.Add(1700 , "numeric" , PgDataType.Decimal , 0, PgTypeFormat.Text, 8); ! DataTypes.Add(1790 , "refcursor" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); ! DataTypes.Add(2277 , "anyarray" , PgDataType.Array , 0, PgTypeFormat.Binary, 8); } public static void InitializeCharSets() { ! Charactersets.Add("SQL_ASCII" , "ascii"); // ASCII ! Charactersets.Add("EUC_JP" , "euc-jp"); // Japanese EUC ! Charactersets.Add("EUC_CN" , "euc-cn"); // Chinese EUC ! Charactersets.Add("UNICODE" , "UTF-8"); // Unicode (UTF-8) ! Charactersets.Add("LATIN1" , "iso-8859-1"); // ISO 8859-1/ECMA 94 (Latin alphabet no.1) ! Charactersets.Add("LATIN2" , "iso-8859-2"); // ISO 8859-2/ECMA 94 (Latin alphabet no.2) ! Charactersets.Add("LATIN4" , 1257); // ISO 8859-4/ECMA 94 (Latin alphabet no.4) ! Charactersets.Add("ISO_8859_7" , 1253); // ISO 8859-7/ECMA 118 (Latin/Greek) ! Charactersets.Add("LATIN9" , "iso-8859-15"); // ISO 8859-15 (Latin alphabet no.9) ! Charactersets.Add("KOI8" , "koi8-r"); // KOI8-R(U) ! Charactersets.Add("WIN" , "windows-1251"); // Windows CP1251 ! Charactersets.Add("WIN1256" , "windows-1256"); // Windows CP1256 (Arabic) ! Charactersets.Add("WIN1256" , "windows-1256"); // Windows CP1256 (Arabic) ! Charactersets.Add("WIN1256" , "windows-1258"); // TCVN-5712/Windows CP1258 (Vietnamese) ! Charactersets.Add("WIN1256" , "windows-874"); // Windows CP874 (Thai) } *************** *** 170,179 **** #region · Callbacks · - public SslConnectionCallback SslConnection - { - get { return this.sslCallback; } - set { this.sslCallback = value; } - } - public NotificationCallback Notification { --- 118,121 ---- *************** *** 192,196 **** #region · Fields · - private SslConnectionCallback sslCallback; private NotificationCallback notification; private InfoMessageCallback infoMessage; --- 134,137 ---- *************** *** 204,208 **** private BinaryReader receive; private BinaryWriter send; ! private PgConnectionParams settings; private char transactionStatus; --- 145,149 ---- private BinaryReader receive; private BinaryWriter send; ! private PgConnectionOptions options; private char transactionStatus; *************** *** 229,236 **** } ! public PgConnectionParams Settings { ! get { return this.settings; } ! set { this.settings = value; } } --- 170,177 ---- } ! public PgConnectionOptions Options { ! get { return this.options; } ! set { this.options = value; } } *************** *** 263,270 **** } ! public PgDbClient(PgConnectionParams settings) { this.parameterStatus = new Hashtable(); ! this.settings = settings; GC.SuppressFinalize(this); --- 204,211 ---- } ! public PgDbClient(PgConnectionOptions settings) { this.parameterStatus = new Hashtable(); ! this.options = settings; GC.SuppressFinalize(this); *************** *** 286,321 **** lock (this) { ! if (this.settings.SSL) { // Send SSL request message this.SSLRequest(); ! if (this.settings.SSL) { this.secureStream = new SslStream(this.networkStream, false); ! this.SecureStream.AuthenticateAsClient(this.settings.ServerName); this.receive = new BinaryReader(this.SecureStream); this.send = new BinaryWriter(this.SecureStream); - - if (this.SslConnection != null) - { - this.SslConnection(); - } } } // Send Startup message ! PgOutputPacket packet = new PgOutputPacket(this.settings.Encoding); packet.Write(PgCodes.PROTOCOL_VERSION3); packet.WriteNullString("user"); ! packet.WriteNullString(this.settings.UserName); ! if (settings.Database != null && this.settings.Database.Length > 0) { packet.WriteNullString("database"); ! packet.WriteNullString(this.settings.Database); } --- 227,257 ---- lock (this) { ! if (this.options.SSL) { // Send SSL request message this.SSLRequest(); ! if (this.options.SSL) { this.secureStream = new SslStream(this.networkStream, false); ! this.SecureStream.AuthenticateAsClient(this.options.ServerName); this.receive = new BinaryReader(this.SecureStream); this.send = new BinaryWriter(this.SecureStream); } } // Send Startup message ! PgOutputPacket packet = new PgOutputPacket(this.options.Encoding); packet.Write(PgCodes.PROTOCOL_VERSION3); packet.WriteNullString("user"); ! packet.WriteNullString(this.options.UserName); ! if (this.options.Database != null && this.options.Database.Length > 0) { packet.WriteNullString("database"); ! packet.WriteNullString(this.options.Database); } *************** *** 457,461 **** } ! responsePacket = new PgResponsePacket(type, Settings.Encoding, buffer); } catch (IOException) --- 393,397 ---- } ! responsePacket = new PgResponsePacket(type, this.options.Encoding, buffer); } catch (IOException) *************** *** 501,505 **** { case "client_encoding": ! settings.Encoding = charSets[parameterValue].Encoding; break; } --- 437,441 ---- { case "client_encoding": ! this.options.Encoding = Charactersets[parameterValue].Encoding; break; } *************** *** 511,515 **** int authType = packet.ReadInt32(); ! PgOutputPacket outPacket = new PgOutputPacket(settings.Encoding); switch (authType) --- 447,451 ---- int authType = packet.ReadInt32(); ! PgOutputPacket outPacket = new PgOutputPacket(this.options.Encoding); switch (authType) *************** *** 529,533 **** case PgCodes.AUTH_CLEARTEXT_PASSWORD: // Cleartext password is required ! outPacket.WriteNullString(settings.UserPassword); break; --- 465,469 ---- case PgCodes.AUTH_CLEARTEXT_PASSWORD: // Cleartext password is required ! outPacket.WriteNullString(this.options.UserPassword); break; *************** *** 544,548 **** // Second calculate md5 of password + user string userHash = MD5Authentication.GetMD5Hash( ! settings.Encoding.GetBytes(settings.UserName), settings.UserPassword); // Third calculate real MD5 hash --- 480,484 ---- // Second calculate md5 of password + user string userHash = MD5Authentication.GetMD5Hash( ! this.options.Encoding.GetBytes(this.options.UserName), this.options.UserPassword); // Third calculate real MD5 hash *************** *** 705,709 **** try { ! PgOutputPacket packet = new PgOutputPacket(Settings.Encoding); // Send packet to the server --- 641,645 ---- try { ! PgOutputPacket packet = new PgOutputPacket(this.options.Encoding); // Send packet to the server *************** *** 723,727 **** try { ! PgOutputPacket packet = new PgOutputPacket(Settings.Encoding); // Send packet to the server --- 659,663 ---- try { ! PgOutputPacket packet = new PgOutputPacket(this.options.Encoding); // Send packet to the server *************** *** 781,785 **** lock (this) { ! this.settings.SSL = false; try --- 717,721 ---- lock (this) { ! this.options.SSL = false; try *************** *** 798,806 **** { case 'S': ! this.settings.SSL = true; break; default: ! this.settings.SSL = false; break; } --- 734,742 ---- { case 'S': ! this.options.SSL = true; break; default: ! this.options.SSL = false; break; } *************** *** 851,863 **** private void InitializeSocket() { ! IPAddress hostadd = Dns.GetHostEntry(settings.ServerName).AddressList[0]; this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // Set Receive Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, settings.PacketSize); // Set Send Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, settings.PacketSize); // Disables the Nagle algorithm for send coalescing. --- 787,799 ---- private void InitializeSocket() { ! IPAddress hostadd = Dns.GetHostEntry(this.options.ServerName).AddressList[0]; this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // Set Receive Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, this.options.PacketSize); // Set Send Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, this.options.PacketSize); // Disables the Nagle algorithm for send coalescing. *************** *** 865,869 **** // Make the socket to connect to the Server ! this.socket.Connect(new IPEndPoint(hostadd, settings.ServerPort)); this.networkStream = new NetworkStream(socket, true); --- 801,805 ---- // Make the socket to connect to the Server ! this.socket.Connect(new IPEndPoint(hostadd, this.options.ServerPort)); this.networkStream = new NetworkStream(socket, true); Index: PgStatement.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgStatement.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgStatement.cs 11 Sep 2005 12:12:31 -0000 1.3 --- PgStatement.cs 11 Sep 2005 13:29:16 -0000 1.4 *************** *** 178,182 **** this.parameters = new PgParameter[0]; ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); packet.WriteNullString(this.ParseName); --- 178,182 ---- this.parameters = new PgParameter[0]; ! PgOutputPacket packet = new PgOutputPacket(this.db.Options.Encoding); packet.WriteNullString(this.ParseName); *************** *** 218,222 **** string name = ((stmtType == 'S') ? this.ParseName : this.PortalName); ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); packet.Write((byte)stmtType); --- 218,222 ---- string name = ((stmtType == 'S') ? this.ParseName : this.PortalName); ! PgOutputPacket packet = new PgOutputPacket(this.db.Options.Encoding); packet.Write((byte)stmtType); *************** *** 257,261 **** try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); // Destination portal name --- 257,261 ---- try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Options.Encoding); // Destination portal name *************** *** 308,312 **** try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); packet.WriteNullString(this.PortalName); --- 308,312 ---- try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Options.Encoding); packet.WriteNullString(this.PortalName); *************** *** 363,367 **** try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); // Function id --- 363,367 ---- try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Options.Encoding); // Function id *************** *** 418,422 **** try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); packet.WriteNullString(this.stmtText); --- 418,422 ---- try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Options.Encoding); packet.WriteNullString(this.stmtText); *************** *** 528,532 **** string name = ((stmtType == 'S') ? this.ParseName : this.PortalName); ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); packet.Write((byte)stmtType); --- 528,532 ---- string name = ((stmtType == 'S') ? this.ParseName : this.PortalName); ! PgOutputPacket packet = new PgOutputPacket(this.db.Options.Encoding); packet.Write((byte)stmtType); *************** *** 699,703 **** this.rowDescriptor.Fields[i].OidTable = packet.ReadInt32(); this.rowDescriptor.Fields[i].OidNumber = packet.ReadInt16(); ! this.rowDescriptor.Fields[i].DataType = PgDbClient.Types[packet.ReadInt32()]; this.rowDescriptor.Fields[i].DataTypeSize = packet.ReadInt16(); this.rowDescriptor.Fields[i].TypeModifier = packet.ReadInt32(); --- 699,703 ---- this.rowDescriptor.Fields[i].OidTable = packet.ReadInt32(); this.rowDescriptor.Fields[i].OidNumber = packet.ReadInt16(); ! this.rowDescriptor.Fields[i].DataType = PgDbClient.DataTypes[packet.ReadInt32()]; this.rowDescriptor.Fields[i].DataTypeSize = packet.ReadInt16(); this.rowDescriptor.Fields[i].TypeModifier = packet.ReadInt32(); Index: PgOutputPacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgOutputPacket.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgOutputPacket.cs 11 Sep 2005 12:12:31 -0000 1.3 --- PgOutputPacket.cs 11 Sep 2005 13:29:16 -0000 1.4 *************** *** 273,277 **** // Get array elements type info ! PgType elementType = PgDbClient.Types[parameter.DataType.ElementType]; size = elementType.Size; --- 273,277 ---- // Get array elements type info ! PgType elementType = PgDbClient.DataTypes[parameter.DataType.ElementType]; size = elementType.Size; Index: PgParameter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgParameter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgParameter.cs 11 Sep 2005 12:12:31 -0000 1.2 --- PgParameter.cs 11 Sep 2005 13:29:16 -0000 1.3 *************** *** 53,57 **** public PgParameter(int dataType) { ! this.dataType = PgDbClient.Types[dataType]; } --- 53,57 ---- public PgParameter(int dataType) { ! this.dataType = PgDbClient.DataTypes[dataType]; } Index: PgCharSetCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgCharSetCollection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgCharSetCollection.cs 11 Sep 2005 12:12:31 -0000 1.2 --- PgCharSetCollection.cs 11 Sep 2005 13:29:16 -0000 1.3 *************** *** 23,40 **** namespace PostgreSql.Data.Protocol { ! internal class PgCharSetCollection : ArrayList { #region · Properties · ! public new PgCharSet this[int index] { ! get { return (PgCharSet)base[index]; } ! set { base[index] = (PgCharSet)value; } } ! public PgCharSet this[string name] { ! get { return (PgCharSet)this[IndexOf(name)]; } ! set { this[IndexOf(name)] = (PgCharSet)value; } } --- 23,46 ---- namespace PostgreSql.Data.Protocol { ! internal sealed class PgCharactersetCollection : CollectionBase { + #region · Fields · + + private ArrayList charactersets; + + #endregion + #region · Properties · ! public PgCharacterSet this[int index] { ! get { return (PgCharacterSet)this.charactersets[index]; } ! set { this.charactersets[index] = (PgCharacterSet)value; } } ! public PgCharacterSet this[string name] { ! get { return (PgCharacterSet)this[this.IndexOf(name)]; } ! set { this[this.IndexOf(name)] = (PgCharacterSet)value; } } *************** *** 43,61 **** #region · Methods · ! public bool Contains(string charset) { ! return (-1 != this.IndexOf(charset)); } ! public int IndexOf(string charset) { int index = 0; ! foreach (PgCharSet item in this) { ! if (this.CultureAwareCompare(item.CharSet, charset)) { return index; } index++; } --- 49,68 ---- #region · Methods · ! public bool Contains(string characterset) { ! return (-1 != this.charactersets.IndexOf(characterset)); } ! public int IndexOf(string characterset) { int index = 0; ! foreach (PgCharacterSet item in this) { ! if (this.CultureAwareCompare(item.Name, characterset)) { return index; } + index++; } *************** *** 66,95 **** public void RemoveAt(string charset) { ! this.RemoveAt(IndexOf(charset)); } ! public PgCharSet Add(PgCharSet charset) { ! base.Add(charset); return charset; } ! public PgCharSet Add(string charset, string systemCharset) { ! PgCharSet charSet = new PgCharSet(charset, systemCharset); ! ! base.Add(charSet); ! ! return charSet; } ! public PgCharSet Add(string charset, int cp) { ! PgCharSet charSet = new PgCharSet(charset, cp); ! ! base.Add(charSet); ! ! return charSet; } --- 73,94 ---- public void RemoveAt(string charset) { ! this.charactersets.RemoveAt(this.IndexOf(charset)); } ! public PgCharacterSet Add(PgCharacterSet charset) { ! this.charactersets.Add(charset); return charset; } ! public PgCharacterSet Add(string charset, string systemCharset) { ! return this.Add(new PgCharacterSet(charset, systemCharset)); } ! public PgCharacterSet Add(string charset, int cp) { ! return this.Add(new PgCharacterSet(charset, cp)); } Index: PgCharSet.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgCharSet.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgCharSet.cs 11 Sep 2005 12:12:31 -0000 1.2 --- PgCharSet.cs 11 Sep 2005 13:29:16 -0000 1.3 *************** *** 21,29 **** namespace PostgreSql.Data.Protocol { ! internal class PgCharSet { #region · Fields · ! private string charSet; private Encoding encoding; --- 21,29 ---- namespace PostgreSql.Data.Protocol { ! internal sealed class PgCharacterSet { #region · Fields · ! private string name; private Encoding encoding; *************** *** 32,38 **** #region · Properties · ! public string CharSet { ! get { return this.charSet; } } --- 32,38 ---- #region · Properties · ! public string Name { ! get { return this.name; } } *************** *** 46,62 **** #region · Constructors · ! public PgCharSet() { } ! public PgCharSet(string charSet, string systemCharSet) { ! this.charSet = charSet; this.encoding = Encoding.GetEncoding(systemCharSet); } ! public PgCharSet(string charSet, int cp) { ! this.charSet = charSet; this.encoding = Encoding.GetEncoding(cp); } --- 46,62 ---- #region · Constructors · ! public PgCharacterSet() { } ! public PgCharacterSet(string name, string systemCharSet) { ! this.name = name; this.encoding = Encoding.GetEncoding(systemCharSet); } ! public PgCharacterSet(string name, int cp) { ! this.name = name; this.encoding = Encoding.GetEncoding(cp); } Index: PgClientMessageEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgClientMessageEventArgs.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgClientMessageEventArgs.cs 11 Sep 2005 12:12:31 -0000 1.2 --- PgClientMessageEventArgs.cs 11 Sep 2005 13:29:16 -0000 1.3 *************** *** 18,22 **** using System; using PostgreSql.Data.Protocol; - using PostgreSql.Data.DbSchema; namespace PostgreSql.Data.Protocol --- 18,21 ---- Index: PgClientNotificationEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Protocol/PgClientNotificationEventArgs.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgClientNotificationEventArgs.cs 11 Sep 2005 12:12:31 -0000 1.3 --- PgClientNotificationEventArgs.cs 11 Sep 2005 13:29:16 -0000 1.4 *************** *** 18,22 **** using System; using PostgreSql.Data.Protocol; - using PostgreSql.Data.DbSchema; namespace PostgreSql.Data.Protocol --- 18,21 ---- |