{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "This is fixed in a changeset prior to 79578. The fix will be in v1.9.1.6",
    "ClosedDate": "2011-06-21T17:37:50.643-07:00",
    "CommentCount": 0,
    "Custom": null,
    "Description": "I'm trying to port Fiddler to DotNetZip from the Xceed library.  However, I'm having a problem with the AddEntry(string, OpenDelegate, CloseDelegate) method. Specifically, sometimes my close delegate is getting called twice (but Open is called only once), and that leads to an exception.  Any idea why this might happen?\n \nthanks for any tips!\n \nException: \nCannot access a closed Stream.;\n   at System.IO.MemoryStream.set_Position(Int64 value)\n   at Ionic.Zip.ZipEntry.PrepSourceStream()\n   at Ionic.Zip.ZipEntry.SetInputAndFigureFileLength(Stream& input)\n   at Ionic.Zip.ZipEntry._WriteEntryData(Stream s)\n   at Ionic.Zip.ZipEntry._EmitOne(Stream outstream)\n   at Ionic.Zip.ZipEntry.Write(Stream s)...",
    "LastUpdatedDate": "2013-05-16T05:31:51.367-07:00",
    "PlannedForRelease": "v1.9.1.8 DotNetZip - Latest Stable",
    "ReleaseVisibleToPublic": true,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2010-03-23T10:47:23.65-07:00",
    "Status": {
      "Name": "Closed",
      "Id": 4
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "CloseDelegate can be called twice",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 4,
    "Id": 10489
  },
  "FileAttachments": [
    {
      "FileId": 2794,
      "FileName": "Ionic.Zip.dll",
      "DownloadUrl": ".\\2794"
    }
  ],
  "Comments": [
    {
      "Message": "Eric, pls try this version of the DLL.   SHA1: FE6F317A6CB59C2E81A5AF78C97963140FEE7FC8 \r\n",
      "PostedDate": "2010-03-23T10:51:45.837-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2010-03-23T10:51:49.987-07:00",
      "Id": -2147483648
    },
    {
      "Message": "I'm also having this same problem using the Ionic.Zip.Reduced.dll (version 1.9.5.2).\r\n\r\nI tried using the Ionic.Zip.dll you attached and it fixed the problem. Is this fix part of a new official release yet?",
      "PostedDate": "2010-05-27T06:25:27.293-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2010-05-27T06:25:36.123-07:00",
      "Id": -2147483648
    },
    {
      "Message": "No - this fix is not yet part of any official release.\r\nI never received confirmation on this. ",
      "PostedDate": "2010-06-02T14:30:22.747-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2010-06-02T15:49:44.157-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2010-06-20T04:32:10.633-07:00",
      "Id": -2147483648
    },
    {
      "Message": "I have the same problem using the AddEntry(string, OpenDelegate, CloseDelegate) method.\r\nwhen the zipFile.CompressionLevel is left to Default value the close delegate is getting called twice leading to exception but when I set the zipFile.CompressionLevel to None the method runs with no exceptions.(actually all levels from level1 and up throw the same exception (Cannot access a closed file).\r\nAny Ideas?\r\nthanks!",
      "PostedDate": "2010-11-10T03:17:55.653-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-03-15T16:57:44.98-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-06-13T11:57:43.863-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-06-21T17:37:50.643-07:00",
      "Id": -2147483648
    },
    {
      "Message": "Same problem here with version 1.9.1.8. It seems that it happen when the readAgain variable in the ZipEntry.Write method is set to true after the first pass.\r\nI fix this locally by adding this on line 1418 in ZipEntry.Write.cs :\r\n\r\n      if (this._CloseDelegate != null)\r\n+    {\r\n          this._CloseDelegate(this.FileName, input);\r\n+        this._sourceStream = null;\r\n+    }\r\n\r\nThis makes the stream being reopened, avoiding crash",
      "PostedDate": "2011-10-18T02:43:02.643-07:00",
      "Id": -2147483648
    },
    {
      "Message": "Hi,\r\n\r\nsame problem on 1.9.1.8 with very small files.\r\n",
      "PostedDate": "2011-12-12T08:26:11.167-08:00",
      "Id": -2147483648
    },
    {
      "Message": "@mika91\r\n\r\nConfirmed in  1.9.1.8 Reduced\r\n\r\nIt throws: (Cannot access a closed file)\r\n\r\n@Cheeso can you reopen it ?",
      "PostedDate": "2012-01-17T12:09:30.667-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:43:37.113-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-05-16T05:31:51.367-07:00",
      "Id": -2147483648
    }
  ]
}