in reply to Re: AnyEvent::HTTP and Socket on Windows
in thread AnyEvent::HTTP and Socket on Windows

The particularly funny part was that AnyEvent::Socket does have that Socket::pack_sockaddr_un call in eval.

So I patched it:

--- Socket.pm 2012-09-27 13:27:38.856750000 +0200 +++ Socket.pm.win32 2012-09-27 13:28:45.466125000 +0200 @@ -579,7 +579,7 @@ module (C<format_address> converts it to # sockaddr_un structures of maximum length (which is not, AFAICS, req +uired # by any standard). try to 0-pad structures for the benefit of those +platforms. -my $sa_un_zero = eval { Socket::pack_sockaddr_un "" }; $sa_un_zero ^= + $sa_un_zero; +my $sa_un_zero = eval { Socket::pack_sockaddr_un "" } unless AnyEvent +::WIN32; $sa_un_zero ^= $sa_un_zero; sub unpack_sockaddr($) { my $af = sockaddr_family $_[0];

But actually, it wasn’t AnyEvent::Socket’s fault. One of the programs has a $SIG{__DIE__} override, while the other doesn’t; for debugging purposes (provides a nice-ish traceback) — and this broke the eval { } in AnyEvent::Socket.

Though, it doesn’t make sense to even attempt to run that function under Win32, so the patch isn’t really without sense.

Replies are listed 'Best First'.
Re^3: AnyEvent::HTTP and Socket on Windows
by Ralesk (Pilgrim) on Sep 27, 2012 at 19:09 UTC

    And mlehmann said that if we’re doing what we’re doing, we’re most certainly breaking other things too that use exceptions, so we should really go fix the die handler.

    For the record: taking into account $^S, using an END { } block and CORE::GLOBAL::die overriding are better.