On Monday 14 April 2008 04:54, nextgens at freenetproject.org wrote:
> Author: nextgens
> Date: 2008-04-14 03:54:31 +0000 (Mon, 14 Apr 2008)
> New Revision: 19297
>
> Modified:
> trunk/freenet/src/freenet/support/io/BaseFileBucket.java
> Log:
> fix #729 and #963: Temporary files grow until fill disk
What is going on here?
>
> Modified: trunk/freenet/src/freenet/support/io/BaseFileBucket.java
> ===================================================================
> --- trunk/freenet/src/freenet/support/io/BaseFileBucket.java 2008-04-14
03:28:27 UTC (rev 19296)
> +++ trunk/freenet/src/freenet/support/io/BaseFileBucket.java 2008-04-14
03:54:31 UTC (rev 19297)
> @@ -393,17 +393,27 @@
>
> if(toClose != null) {
> Logger.error(this, "Streams open
free()ing "+this+" : "+StringArray.toString(toClose), new
Exception("debug"));
> - for(int i=0;i<toClose.length;i++) {
> - try {
> - if(toClose[i] instanceof
> FileBucketOutputStream) {
> - ((FileBucketOutputStream)
> toClose[i]).close();
> - } else {
> - ((FileBucketInputStream)
> toClose[i]).close();
> + double toCloseLength = toClose.length;
> + while(toCloseLength > 0) {
> + int toCloseThisRound;
> + if(toCloseLength <= Integer.MAX_VALUE) {
> + toCloseThisRound = (int) toCloseLength;
> + toCloseLength = 0;
> + } else
> + toCloseLength -= (toCloseThisRound =
> Integer.MAX_VALUE);
> +
> + for(int i=0; i<toCloseThisRound; i++) {
> + try {
> + if(toClose[i] instanceof
> FileBucketOutputStream) {
> +
> ((FileBucketOutputStream) toClose[i]).close();
> + } else {
> +
> ((FileBucketInputStream) toClose[i]).close();
> + }
> + } catch (IOException e) {
> + Logger.error(this, "Caught
> closing stream in free(): "+e, e);
> + } catch (Throwable t) {
> + Logger.error(this, "Caught
> closing stream in free(): "+t, t);
> }
> - } catch (IOException e) {
> - Logger.error(this, "Caught closing
> stream in free(): "+e, e);
> - } catch (Throwable t) {
> - Logger.error(this, "Caught closing
> stream in free(): "+t, t);
> }
> }
> }
>
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20080414/d98c6410/attachment.pgp>