I'm running into an extremely frustrating situation where I'm trying to POST the contents of a very large file, but appear to be running into timeout issues. I'm working with a Google Search Appliance where the only way to get data into it is through a standard HTTP POST (other than having it crawl, of course). Here's the snippet where the actual POST is taking place:
# Post content to the supplied URL my $ua = new LWP::UserAgent; $ua->timeout( 3600 ); my $response = $ua->post( $url, Content_Type => 'multipart/form-data', Content => [ feedtype => $feedtype, datasource => $datasource, data => [ $xmlfile, $filename, Content_Type => $mimetype ] ] ); # Final error check throw Error::Simple( $response->message ) if( !$response->is_succe +ss ); print "Success"; } catch Error::Simple with { my $E = shift; print "ERROR: ", $E->text; } finally { print "\n"; };
In the above, $xmlfile is the actual location of the XML file being posted, while $filename is the name of the XML file itself. The file I'm trying to post is about 100MB (and sometimes even larger). Unfortunately, after a few minutes of running the script, I get the following error:
server closed connection without any data back
At other times, I'm simply getting an EOF and then sudden death. I've tried everything known to me without any luck at all. Thinking that it may be a timeout issue, I set it to an hour. That didn't appear to solve the issue at all. Any help here would be enormously appreciated. Thanks, Saker

In reply to Frustrating LWP timeouts -- help! by sghani

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.