Menu

#73 chunk size fails on second chunk

v1.0_(example)
pending
nobody
None
1
2014-10-14
2012-11-01
Anonymous
No

v5.08 build 1637
max chunksize fails on second chunk
Test secnario

While testing server side code noticed this while using "advanced" mode

file size 948 bytes.
maxchunksize 100 bytes
first chunk sent = 100 bytes
second chunk sent = 848 bytes

Discussion

  • Anonymous

    Anonymous - 2012-11-02

    update on above. It appears that it is the last chunk of a series that is not properly "chunked".

    test: 11458 byte file
    mode: iterative
    chunksize 1000

    produces a series of "sends" each 1000 bytes that are acknowledged individually by the read
    statement where $bytes is 1000 EXCEPT the last send. Which produces two passes through the read loop with acknowledgement of 1024, 458

    The read statement while loop is:

    $bytes = read($fh, $buffer, 1024);

    Additionally, the md5 sum sent with each chunk is the same and is the md5 of the entire file, not the md5sum of the individual chunk as specified in the documentation.

    MikeR michael@bizsystems.com

     
  • Anonymous

    Anonymous - 2012-11-05

    Vu

    You're right. The length of the last chunk may be wrong.

    It's actually a matter of bytes : it may exceed the maxChunkSize by as much as the total number of bytes in the head and the tail for the previous chunk.

    The correction is quite simple, but I'll add junit tests around, to prevent this to happen again.

    I guess you have no 'real' problem due to this issue, right ?

    For me, it's a minor bug. I can't connect to sf to change this on this filed bug : it doesn't work from my iPhone, neither from my current network !
    :-(

    Regards
    Etienne

     
  • Etienne

    Etienne - 2012-11-05

    And I'll check the md5sum.

    I'll probably change the doc, not the code. I'll check it, but I guess it's not that simple.

    Etienne

     
  • Etienne

    Etienne - 2012-11-12
    • status: open --> pending
     
  • Etienne

    Etienne - 2012-11-12

    Thanks for the report.

    The correction is now commited. It will be available in the next release.

    As it doesn't seem that important, I won't do a release now.

    Ok for you ?

    etienne

     
  • Etienne

    Etienne - 2012-11-12

    BTW : I saw nowhere in the doc, an indication that the md5sum is per chunk...

     

Anonymous
Anonymous

Add attachments
Cancel