Commit e9142a9
Handle undef and empty LocalAddr
IO::Socket::INET interprets undefined and empty string LocalAddr
arguments as an unspecified address while IO::Socket::IP returns an
error. This seems to be one of the differences between the two
Socket implementations. Recent IO::Socket::IP (0.39) accepts undefined
value, but still bail outs on an empty string:
$ perl -Ilib -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>undef) or die; print $d->url, qq{\n}'
http://fedora-31:42587/
$ perl -Ilib -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>q{}) or die; print $d->url, qq{\n}'
Name or service not known ...propagated at -e line 1.
To improve compatibility, this patch adds a special handling for these
two values to be accepted as an unspecified value. Though this should
be corrected on IO::Socket:IP side probably.
CPAN RT#91699
CPAN RT#123069
Signed-off-by: Petr Písař <ppisar@redhat.com>1 parent 7ab7ebd commit e9142a9
2 files changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
| |||
0 commit comments