There was an issue in PipeWindow.java where the available size could drop below 0 and the check was for exactly zero. Changing this to less than or equal to fixed that issue.
In addition to that, there is apparently a call to ProxyOutputStream.connect and subsequently channel.getpipewindow which causes ProxyOutputStream.window to get set to null. A quick check for window == null prior to using it appears to resolve that issue.
[HUDSON-7745] Fix for two of the errors described in this bug report.…
… This is just a band-aid and ultimately someone should take a look at rewriting this.
Re: Your JIRA comment: this kohsuke/hudson repo is a month behind the "official" repo at hudson/hudson.
And thanks for hopefully solving some of these copy issues :)
crap, I wasn't sure which one was the mainline; I'll fork hudson/hudson for the future. Hopefully this helps. The major failure, which I witnessed while I was running the tests locally, was the "Not in GZIP format" error.
Also, the current Hudson build on ci.hudson-ci.org has been hanging for like 4 days.
I'm going to close this and submit the same request on hudson/hudson.