perlquestion
Eyck
Salut,
<p>I've got a little problem with great DAV-explorer - 'dave', it has got a great interface, works fine, until you try to impress your peers and show off it's abilities by transferring securely and easily (https) few gigabyte sized file...
<br>your workstation suddenly melts. Not good.
<p>Here's the culprit:
<code>
binmode F;
while(<F>) { $content .= $_; }
close F;
</code>
<p>All is well and good, although this code appears not in dave itself, but in [cpan://HTTP::Dav] library (line 877, <i>/usr/share/perl5/HTTP/DAV.pm</i>), since this problem exists in library and not in dave, it's way harder to fix, especially since the problem here actually is not with HTTP::Dav, but with [cpan://LWP] itself, because it requires $content parameter to be copied scalar..
<p>Fixing [cpan://LWP] would be rather heroic task, it is widely used, you would have to either change it's API, or maybe extend it to support passing filehandles...
<br>
<p>What are the options? It's obvious that one would try to make his fixes as non-invasive as possible (fixing relatively esoteric [cpan://HTTP::Dav]) but the more logical and usefull thing would be to fix the problem at it's source.., is there some way to MMAP a file into scalar? how should one go about changing as popular lib as LWP?