… | |
… | |
140 | |
140 | |
141 | The request headers to use. Currently, C<http_request> may provide its |
141 | The request headers to use. Currently, C<http_request> may provide its |
142 | own C<Host:>, C<Content-Length:>, C<Connection:> and C<Cookie:> headers |
142 | own C<Host:>, C<Content-Length:>, C<Connection:> and C<Cookie:> headers |
143 | and will provide defaults for C<User-Agent:> and C<Referer:> (this can be |
143 | and will provide defaults for C<User-Agent:> and C<Referer:> (this can be |
144 | suppressed by using C<undef> for these headers in which case they won't be |
144 | suppressed by using C<undef> for these headers in which case they won't be |
145 | send at all). |
145 | sent at all). |
146 | |
146 | |
147 | =item timeout => $seconds |
147 | =item timeout => $seconds |
148 | |
148 | |
149 | The time-out to use for various stages - each connect attempt will reset |
149 | The time-out to use for various stages - each connect attempt will reset |
150 | the timeout, as will read or write activity. Default timeout is 5 minutes. |
150 | the timeout, as will read or write activity. Default timeout is 5 minutes. |
… | |
… | |
702 | }); |
702 | }); |
703 | } else { |
703 | } else { |
704 | &$handle_actual_request; |
704 | &$handle_actual_request; |
705 | } |
705 | } |
706 | |
706 | |
707 | }, sub { |
707 | }, $arg{on_prepare} || sub { $timeout }; |
708 | $timeout |
|
|
709 | }; |
|
|
710 | }; |
708 | }; |
711 | |
709 | |
712 | defined wantarray && AnyEvent::Util::guard { %state = () } |
710 | defined wantarray && AnyEvent::Util::guard { %state = () } |
713 | } |
711 | } |
714 | |
712 | |