This is a bug report for perl from bo.joh...@lsn.se,
generated with the help of perlbug 1.39 running under perl 5.12.2.
-----------------------------------------------------------------
[Please describe your issue here]
The perl function listen does not return when host is undefined or 0.0.0.0.
Sometimes it also gets Windows 7 in unstable state and normal shut down is impossible.
Example: This is setup_listener from HTTP-Server-Simple-0.44/lib/HTTP/Server/Simple.pm
sub setup_listener {
my $self = shift;
my $tcp = getprotobyname('tcp');
socket( HTTPDaemon, PF_INET, SOCK_STREAM, $tcp ) or croak "socket: $!";
setsockopt( HTTPDaemon, SOL_SOCKET, SO_REUSEADDR, pack( "l", 1 ) )
or warn "setsockopt: $!";
bind( HTTPDaemon,
sockaddr_in(
$self->port(),
( $self->host
? inet_aton( $self->host )
: INADDR_ANY
)
)
)
or croak "bind to @{[$self->host||'*']}:@{[$self->port]}: $!";
listen( HTTPDaemon, SOMAXCONN ) or croak "listen: $!";
}
If $self->host is undefined or '0.0.0.0' the call to listen does not return.
Sometimes it gets Windows 7 in unstable state and
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl 5.12.2:
Configured by 1 at Fri Nov 5 08:33:05 2010.
Summary of my perl5 (revision 5 version 12 subversion 2) configuration:
Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname='Win32 strawberryperl 5.12.2.0 #1 Fri Nov 5 05:17:27 2010 i386'
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX',
optimize='-s -O2',
cppflags='-DWIN32'
ccversion='', gccversion='4.4.3', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
libpth=C:\strawberry\c\lib C:\strawberry\c\i686-w64-mingw32\lib
libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
libc=, so=dll, useshrplib=true, libperl=libperl512.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
Locally applied patches:
---
@INC for perl 5.12.2:
C:/strawberry/perl/site/lib
C:/strawberry/perl/vendor/lib
C:/strawberry/perl/lib
.
---
Environment for perl 5.12.2:
HOME (unset)
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\ArcSoft\Bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;c:\Parrot-2.8.0\bin;S:\ins\ant\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;c:\Program Files\Emacs\EmacsW32\gnuwin32\bin\;c:\Program Files\Java\jdk1.6.0_16\bin;C:\hp\bin\Python;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Graphviz2.26.3\bin;C:\strawberry\c\bin;C:\strawberry\perl\bin;C:\gnuwin32\bin;C:\Parrot-2.8.0\bin;C:\Parrot-2.8.0\bin;C:\Program Files\Windows Live\Shared;C:\Program Files\QuickTime\QTSystem\;C:\strawberry\perl\site\bin;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files\Git\cmd
PERL_BADLANG (unset)
SHELL (unset)
Hej!
I have run:
use strict;
use warnings;
use HTTP::Server::Simple;
my $server = HTTP::Server::Simple->new();
$server->host( undef );
#$server->host( '0.0.0.0' );
$server->run();
Using "$server->host( undef );" or "$server->host(
'0.0.0.0' );" works with HTTP::Server::Simple
version 0.51!