Ralesk has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monks,
So, recently, to get around the whole blocking issue with LWP, we’ve switched to using AnyEvent::HTTP instead.
In most cases, this seems to work well, except for one, where seemingly the same call runs into AnyEvent::Socket wanting to mess around with Socket::pack_sockaddr_un, which isn’t implemented under Win32. (Pox on non-POSIX systems)
In particular, I have a module that does the whole HTTP management, and both the broken and the working application call its call() method. Which is nothing spectacular:
sub call { my $self = shift; my ($method, $path, $format, $query, $content, $cb) = @_; $self->{Request} = HTTP::Request->new( $method, "https://$self->{host}/cgi-bin/api/" . join('/', @$path) . (". +$format") . ($query ? "?$query" : "") ); $self->{Request}->content($content) if $content; $self->_head($self->{Request}, $cb); }
(In during a pox on AnyEvent::HTTP for not using HTTP::{Request,Response,Headers} etc.)
_head probes the URI with a HEAD request, gets the nonce, and then does a proper _request with the proper Digest response. And passes over the callback function which was defined during call’s call.
For some reason, one of the apps does this fine (even under Windows), while the other croaks with the above problem. I simply don’t see what could be different between the two.
$api->call(GET => ['foo', $spam], 'json', undef, undef, s +ub { ... }); ## Program M, works $api->call(GET => ['bar', $spam, 'baz', $ham], 'json', undef, undef, s +ub { ... }); ## Program C, doesn't work
So, no idea at this point.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: AnyEvent::HTTP and Socket on Windows
by bulk88 (Priest) on Sep 21, 2012 at 20:43 UTC | |
by Ralesk (Pilgrim) on Sep 27, 2012 at 06:57 UTC | |
|
Re: AnyEvent::HTTP and Socket on Windows
by Anonymous Monk on Sep 27, 2012 at 07:23 UTC | |
by Ralesk (Pilgrim) on Sep 27, 2012 at 11:49 UTC | |
by Ralesk (Pilgrim) on Sep 27, 2012 at 19:09 UTC | |
by Ralesk (Pilgrim) on Sep 27, 2012 at 09:57 UTC |