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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
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
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
BTW : I saw nowhere in the doc, an indication that the md5sum is per chunk...