… | |
… | |
120 | |
120 | |
121 | You really should provide your own "User-Agent:" header value |
121 | You really should provide your own "User-Agent:" header value |
122 | that is appropriate for your program - I wouldn't be surprised |
122 | that is appropriate for your program - I wouldn't be surprised |
123 | if the default AnyEvent string gets blocked by webservers sooner |
123 | if the default AnyEvent string gets blocked by webservers sooner |
124 | or later. |
124 | or later. |
|
|
125 | |
|
|
126 | Also, make sure that your headers names and values do not |
|
|
127 | contain any embedded newlines. |
125 | |
128 | |
126 | timeout => $seconds |
129 | timeout => $seconds |
127 | The time-out to use for various stages - each connect attempt |
130 | The time-out to use for various stages - each connect attempt |
128 | will reset the timeout, as will read or write activity, i.e. |
131 | will reset the timeout, as will read or write activity, i.e. |
129 | this is not an overall timeout. |
132 | this is not an overall timeout. |
… | |
… | |
489 | |
492 | |
490 | warn stat $fh; |
493 | warn stat $fh; |
491 | warn -s _; |
494 | warn -s _; |
492 | if (stat $fh and -s _) { |
495 | if (stat $fh and -s _) { |
493 | $ofs = -s _; |
496 | $ofs = -s _; |
494 | warn "-s is ", $ofs;#d# |
497 | warn "-s is ", $ofs; |
495 | $hdr{"if-unmodified-since"} = AnyEvent::HTTP::format_date +(stat _)[9]; |
498 | $hdr{"if-unmodified-since"} = AnyEvent::HTTP::format_date +(stat _)[9]; |
496 | $hdr{"range"} = "bytes=$ofs-"; |
499 | $hdr{"range"} = "bytes=$ofs-"; |
497 | } |
500 | } |
498 | |
501 | |
499 | http_get $url, |
502 | http_get $url, |