ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-HTTP/HTTP.pm
(Generate patch)

Comparing AnyEvent-HTTP/HTTP.pm (file contents):
Revision 1.132 by root, Thu Aug 30 17:05:45 2018 UTC vs.
Revision 1.134 by root, Fri Sep 7 22:11:31 2018 UTC

264establishes connections. Normally it uses L<AnyEvent::Socket::tcp_connect> 264establishes connections. Normally it uses L<AnyEvent::Socket::tcp_connect>
265to do this, but you can provide your own C<tcp_connect> function - 265to do this, but you can provide your own C<tcp_connect> function -
266obviously, it has to follow the same calling conventions, except that it 266obviously, it has to follow the same calling conventions, except that it
267may always return a connection guard object. 267may always return a connection guard object.
268 268
269The connections made by this hook will be treated as equivalent to
270connecitons made the built-in way, specifically, they will be put into
271and taken from the persistent conneciton cache. If your C<$tcp_connect>
272function is incompatible with this kind of re-use, consider switching off
273C<persistent> connections and/or providing a C<session> identifier.
274
269There are probably lots of weird uses for this function, starting from 275There are probably lots of weird uses for this function, starting from
270tracing the hosts C<http_request> actually tries to connect, to (inexact 276tracing the hosts C<http_request> actually tries to connect, to (inexact
271but fast) host => IP address caching or even socks protocol support. 277but fast) host => IP address caching or even socks protocol support.
272 278
273=item on_header => $callback->($headers) 279=item on_header => $callback->($headers)
342=item persistent => $boolean 348=item persistent => $boolean
343 349
344Try to create/reuse a persistent connection. When this flag is set 350Try to create/reuse a persistent connection. When this flag is set
345(default: true for idempotent requests, false for all others), then 351(default: true for idempotent requests, false for all others), then
346C<http_request> tries to re-use an existing (previously-created) 352C<http_request> tries to re-use an existing (previously-created)
347persistent connection to the host and, failing that, tries to create a new 353persistent connection to same host (i.e. identical URL scheme, hostname,
348one. 354port and session) and, failing that, tries to create a new one.
349 355
350Requests failing in certain ways will be automatically retried once, which 356Requests failing in certain ways will be automatically retried once, which
351is dangerous for non-idempotent requests, which is why it defaults to off 357is dangerous for non-idempotent requests, which is why it defaults to off
352for them. The reason for this is because the bozos who designed HTTP/1.1 358for them. The reason for this is because the bozos who designed HTTP/1.1
353made it impossible to distinguish between a fatal error and a normal 359made it impossible to distinguish between a fatal error and a normal

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines