Attachment 'heritrix-1.12.1b.diff'

Download

   1 diff -ur heritrix-1.12.1a/project.xml heritrix-1.12.1b/project.xml
   2 --- heritrix-1.12.1a/project.xml	2007-05-08 18:07:08.000000000 +0200
   3 +++ heritrix-1.12.1b/project.xml	2007-07-06 11:54:56.000000000 +0200
   4 @@ -48,7 +48,7 @@
   5      be picked up and appended to the currentVersion.  Handy for continuous
   6      builds if the version.build.suffix holds time of build.
   7      -->
   8 -  <currentVersion>1.12.1</currentVersion>
   9 +  <currentVersion>1.12.1b</currentVersion>
  10    
  11    <!-- Details about the organization that 'owns' the project -->
  12    <organization>
  13 diff -ur heritrix-1.12.1a/src/java/org/archive/io/ArchiveReader.java heritrix-1.12.1b/src/java/org/archive/io/ArchiveReader.java
  14 --- heritrix-1.12.1a/src/java/org/archive/io/ArchiveReader.java	2007-05-08 18:07:08.000000000 +0200
  15 +++ heritrix-1.12.1b/src/java/org/archive/io/ArchiveReader.java	2007-07-06 11:54:56.000000000 +0200
  16 @@ -444,6 +444,12 @@
  17              this.count = 0;
  18              ((RandomAccessInputStream)this.in).position(position);
  19          }
  20 +
  21 +        public int available() throws IOException {
  22 +            // Avoid overflow on large datastreams
  23 +            long amount = (long)in.available() + (long)(count - pos);
  24 +            return (amount >= Integer.MAX_VALUE)? Integer.MAX_VALUE: (int)amount;
  25 +        }
  26      }
  27      
  28      /**
  29 diff -ur heritrix-1.12.1a/src/java/org/archive/io/ArchiveRecord.java heritrix-1.12.1b/src/java/org/archive/io/ArchiveRecord.java
  30 --- heritrix-1.12.1a/src/java/org/archive/io/ArchiveRecord.java	2007-05-08 18:07:08.000000000 +0200
  31 +++ heritrix-1.12.1b/src/java/org/archive/io/ArchiveRecord.java	2007-07-06 11:54:56.000000000 +0200
  32 @@ -224,7 +224,8 @@
  33  	 * @return True if bytes remaining in record content.
  34  	 */
  35      public int available() {
  36 -        return (int)(getHeader().getLength() - getPosition());
  37 +        long amount = getHeader().getLength() - getPosition();
  38 +        return (amount > Integer.MAX_VALUE? Integer.MAX_VALUE: (int)amount);
  39      }
  40  
  41      /**
  42 @@ -240,7 +241,7 @@
  43          // Read to the end of the body of the record.  Exhaust the stream.
  44          // Can't skip direct to end because underlying stream may be compressed
  45          // and we're calculating the digest for the record.
  46 -        if (available() > 0) {
  47 +        while (available() > 0 && !this.eor) {
  48              skip(available());
  49          }
  50      }

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-11-09 11:14:44, 10029.8 KB) [[attachment:heritrix-1.12.1b-src.zip]]
  • [get | view] (2007-11-09 11:13:18, 2.3 KB) [[attachment:heritrix-1.12.1b.diff]]
  • [get | view] (2007-11-09 11:14:11, 19189.0 KB) [[attachment:heritrix-1.12.1b.zip]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.