{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "fixed in changeset 43907.  First bin 1.9.0.10",
    "ClosedDate": "2009-09-23T13:10:58.683-07:00",
    "CommentCount": 0,
    "Custom": null,
    "Description": "I've been working on using your ZLib DLL inside MS SQL Server so that I can use it in a CLR SP.  SQL Server has some special requirements for SAFE/EXTERNAL assemblies.  The only one that is a problem here is the use of non-readonly static variables.  Luckily readonly appears to be compatible with all uses of static variables in Zlib.  So here is a patch to implement that.  The unit tests pass and my limited testing indicates that everything works OK.\n \n \ndiff -u -r DotNetZip-1.8.4.23/ZLib/Crc32.cs DotNetZip-dev/ZLib/Crc32.cs\n--- DotNetZip-1.8.4.23/ZLib/Crc32.cs\t2009-08-18 21:04:20.000000000 -0500\n+++ DotNetZip-dev/ZLib/Crc32.cs\t2009-09-16 16:39:50.514842500 -0500\n@@ -197,7 +197,7 @@\n \n         // private member vars\n         private Int64 _TotalBytesRead;\n-        private static UInt32[] crc32Table;\n+        private static readonly UInt32[] crc32Table;\n         private const int BUFFER_SIZE = 8192;\n         private UInt32 _RunningCrc32Result = 0xFFFFFFFF;\n \ndiff -u -r DotNetZip-1.8.4.23/ZLib/Deflate.cs DotNetZip-dev/ZLib/Deflate.cs\n--- DotNetZip-1.8.4.23/ZLib/Deflate.cs\t2009-08-19 18:25:04.000000000 -0500\n+++ DotNetZip-dev/ZLib/Deflate.cs\t2009-09-21 10:34:14.384813900 -0500\n@@ -189,7 +189,7 @@\n                 };\n             }\n \n-            private static Config[] Table;\n+            private static readonly Config[] Table;\n         }\n \n \ndiff -u -r DotNetZip-1.8.4.23/ZLib/GZipStream.cs DotNetZip-dev/ZLib/GZipStream.cs\n--- DotNetZip-1.8.4.23/ZLib/GZipStream.cs\t2009-08-12 15:35:30.000000000 -0500\n+++ DotNetZip-dev/ZLib/GZipStream.cs\t2009-09-16 16:39:50.366827700 -0500\n@@ -774,8 +774,8 @@\n         #endregion\n \n \n-        internal static System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);\n-        internal static System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding(\"iso-8859-1\");\n+        internal static readonly System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);\n+        internal static readonly System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding(\"iso-8859-1\");\n \n \n         private int EmitHeader()\ndiff -u -r DotNetZip-1.8.4.23/ZLib/Inflate.cs DotNetZip-dev/ZLib/Inflate.cs\n--- DotNetZip-1.8.4.23/ZLib/Inflate.cs\t2009-05-31 09:15:22.000000000 -0500\n+++ DotNetZip-dev/ZLib/Inflate.cs\t2009-09-16 16:39:50.453836400 -0500\n@@ -1756,7 +1756,7 @@\n             return ZlibConstants.Z_OK;\n         }\n \n-        private static byte[] mark = new byte[] { 0, 0, 0xff, 0xff };\n+        private static readonly byte[] mark = new byte[] { 0, 0, 0xff, 0xff };\n \n         internal int Sync()\n         {\ndiff -u -r DotNetZip-1.8.4.23/ZLib/Zlib.cs DotNetZip-dev/ZLib/Zlib.cs\n--- DotNetZip-1.8.4.23/ZLib/Zlib.cs\t2009-08-14 09:51:42.000000000 -0500\n+++ DotNetZip-dev/ZLib/Zlib.cs\t2009-09-21 10:33:11.138489900 -0500\n@@ -374,13 +374,13 @@\n         internal static readonly short[] static_dtree = new short[] { 0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5 };\n \n         //UPGRADE_NOTE: The initialization of  'static_l_desc' was moved to static method 'com.jcraft.jzlib.StaticTree'. \"ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1005'\"\n-        internal static StaticTree static_l_desc;\n+        internal static readonly StaticTree static_l_desc;\n \n         //UPGRADE_NOTE: The initialization of  'static_d_desc' was moved to static method 'com.jcraft.jzlib.StaticTree'. \"ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1005'\"\n-        internal static StaticTree static_d_desc;\n+        internal static readonly StaticTree static_d_desc;\n \n         //UPGRADE_NOTE: The initialization of  'static_bl_desc' was moved to static method 'com.jcraft.jzlib.StaticTree'. \"ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1005'\"\n-        internal static StaticTree static_bl_desc;\n+        internal static readonly StaticTree static_bl_desc;\n \n         internal short[] static_tree; // static tree or null\n         internal int[] extra_bits; // extra bits for each code or null\n@@ -416,9 +416,9 @@\n     internal sealed class Adler\n     {\n         // largest prime smaller than 65536\n-        private static int BASE = 65521;\n+        private static readonly int BASE = 65521;\n         // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1\n-        private static int NMAX = 5552;\n+        private static readonly int NMAX = 5552;\n \n         static internal long Adler32(long adler, byte[] buf, int index, int len)\n         {\n \n \n \ndiff -u -r DotNetZip-1.8.4.23/ZLib/Crc32.cs DotNetZip-dev/ZLib/Crc32.cs--- DotNetZip-1.8.4.23/ZLib/Crc32.cs    2009-08-18 21:04:20.000000000 -0500+++ DotNetZip-dev/ZLib/Crc32.cs    2009-09-16 16:39:50.514842500 -0500@@ -197,7 +197,7 @@          // private member vars         private Int64 _TotalBytesRead;-        private static UInt32[] crc32Table;+        private static readonly UInt32[] crc32Table;         private const int BUFFER_SIZE = 8192;         private UInt32 _RunningCrc32Result = 0xFFFFFFFF; diff -u -r DotNetZip-1.8.4.23/ZLib/Deflate.cs DotNetZip-dev/ZLib/Deflate.cs--- DotNetZip-1.8.4.23/ZLib/Deflate.cs    2009-08-19 18:25:04.000000000 -0500+++ DotNetZip-dev/ZLib/Deflate.cs    2009-09-21 10:34:14.384813900 -0500@@ -189,7 +189,7 @@                 };             } -            private static Config[] Table;+            private static readonly Config[] Table;         }  diff -u -r DotNetZip-1.8.4.23/ZLib/GZipStream.cs DotNetZip-dev/ZLib/GZipStream.cs--- DotNetZip-1.8.4.23/ZLib/GZipStream.cs    2009-08-12 15:35:30.000000000 -0500+++ DotNetZip-dev/ZLib/GZipStream.cs    2009-09-16 16:39:50.366827700 -0500@@ -774,8 +774,8 @@         #endregion  -        internal static System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);-        internal static System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding(\"iso-8859-1\");+        internal static readonly System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);+        internal static readonly System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding(\"iso-8859-1\");           private int EmitHeader()diff -u -r DotNetZip-1.8.4.23/ZLib/Inflate.cs DotNetZip-dev/ZLib/Inflate.cs--- DotNetZip-1.8.4.23/ZLib/Inflate.cs    2009-05-31 09:15:22.000000000 -0500+++ DotNetZip-dev/ZLib/Inflate.cs    2009-09-16 16:39:50.453836400 -0500@@ -1756,7 +1756,7 @@             return ZlibConstants.Z_OK;         } -        private static byte[] mark = new byte[] { 0, 0, 0xff, 0xff };+        private static readonly byte[] mark = new byte[] { 0, 0, 0xff, 0xff };          internal int Sync()         {diff -u -r DotNetZip-1.8.4.23/ZLib/Zlib.cs DotNetZip-dev/ZLib/Zlib.cs--- DotNetZip-1.8.4.23/ZLib/Zlib.cs    2009-08-14 09:51:42.000000000 -0500+++ DotNetZip-dev/ZLib/Zlib.cs    2009-09-21 10:33:11.138489900 -0500@@ -374,13 +374,13 @@         internal static readonly short[] static_dtree = new short[] { 0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5 };          //UPGRADE_NOTE: The initialization of  'static_l_desc' was moved to static method 'com.jcraft.jzlib.StaticTree'. \"ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1005'\"-        internal static StaticTree static_l_desc;+        internal static readonly StaticTree static_l_desc;          //UPGRADE_NOTE: The initialization of  'static_d_desc' was moved to static method 'com.jcraft.jzlib.StaticTree'. \"ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1005'\"-        internal static StaticTree static_d_desc;+        internal static readonly StaticTree static_d_desc;          //UPGRADE_NOTE: The initialization of  'static_bl_desc' was moved to static method 'com.jcraft.jzlib.StaticTree'. \"ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1005'\"-        internal static StaticTree static_bl_desc;+        internal static readonly StaticTree static_bl_desc;          internal short[] static_tree; // static tree or null         internal int[] extra_bits; // extra bits for each code or null@@ -416,9 +416,9 @@     internal sealed class Adler     {         // largest prime smaller than 65536-        private static int BASE = 65521;+        private static readonly int BASE = 65521;         // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1-        private static int NMAX = 5552;+        private static readonly int NMAX = 5552;          static internal long Adler32(long adler, byte[] buf, int index, int len)         {",
    "LastUpdatedDate": "2013-05-16T05:32:07.103-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2009-09-21T23:51:02.16-07:00",
    "Status": {
      "Name": "Closed",
      "Id": 4
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Loading Ionic.Zlib.dll as an assembly in MS SQL Server",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 8821
  },
  "FileAttachments": [],
  "Comments": []
}