libwww-perl / HTTP-Daemon

A simple http server class
http://metacpan.org/release/HTTP-Daemon/
Other
6 stars 16 forks source link

[MACOS] HTTP::Daemon not working since 6.05 on MacOS #35

Closed g-bougard closed 5 years ago

g-bougard commented 5 years ago

Hi, we are using HTTP::Daemon in fusioninventory-agent to build a portable inventory agent. I started to notice a failure on CircleCI tests this summer and as I had to rebuild our perl for our MacOS package I discovered HTTP::Daemon was no more working. I had to revert to HTTP::Daemon@6.04 with cpanm to have it working.

In CircleCI, our tests are showing this error:

t/agent/http/server.t ............................... 1/12 Bad arg length for Socket::unpack_sockaddr_in, length is 28, should be 16 at /System/Library/Perl/5.18/darwin-thread-multi-2level/Socket.pm line 824.
# Looks like your test exited with 29 just after 2.

t/agent/http/server.t ............................... Dubious, test returned 29 (wstat 7424, 0x1d00)

see our CircleCI build 821. It seems CircleCI uses perl 5.18 but I built perl 5.30 and it wasn't working too.

skaji commented 5 years ago

First, try the latest version 6.06.

g-bougard commented 5 years ago

It fails on 6.06. And I also tested 6.05, and it fails too. If you check the CircleCI build, you can see:

Searching HTTP::Daemon (6) on cpanmetadb ...
--> Working on HTTP::Daemon
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/HTTP-Daemon-6.06.tar.gz ... OK
Unpacking HTTP-Daemon-6.06.tar.gz
...
skaji commented 5 years ago

Can you show us simple code that does not work with the latest HTTP::Daemon?

g-bougard commented 5 years ago

Yes, I'm trying to setup a circle ci test environnement and will try to add a test if nothing is failing.

g-bougard commented 5 years ago

I definitively failed to setup a circle ci environment for that. Btw I investigated more deeper the problem and also read some man, the Socket one especially. I finally found our code was only supporting IPv4 and that was probably the real problem. As I was only able to reproduce the problem on MacOS and that was because I suspected a specific problem on that platform, but I know now how to reproduce the error on linux. So I modified our code with this PR: Feature: fix httpd server ipv6 support #729 Now tests are no more failing under CircleCI.