Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Salut,

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...
your workstation suddenly melts. Not good.

Here's the culprit:

binmode F; while(<F>) { $content .= $_; } close F;

All is well and good, although this code appears not in dave itself, but in HTTP::Dav library (line 877, /usr/share/perl5/HTTP/DAV.pm), 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 LWP itself, because it requires $content parameter to be copied scalar..

Fixing 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...

What are the options? It's obvious that one would try to make his fixes as non-invasive as possible (fixing relatively esoteric 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?


In reply to Fixing a problem in deep object hierarchy (slurp in a library) by Eyck

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-03-19 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found