Fwd: [Catalyst] Why I get this error sometimes when run catalyst

Liu Xiao-Guang leoshawnk at gmail.com
Fri Nov 10 05:40:05 GMT 2006


Forward 2 emails from Jesper Krogh on 2006-10-3.

Maybe helpful.



>
>
>
>
> > Hi all.
> >
> >
> > This is a small patch that makes the testserver survive Internet
> > Explorer..
>
> This one even works..
>
> --- /usr/share/perl5/Catalyst/Engine/HTTP.pm    2006-07-19
> 23:45:16.000000000 +0200
> +++ lib/Catalyst/Engine/HTTP.pm 2006-10-03 12:02:25.000000000 +0200
> @@ -305,13 +305,14 @@
>      my ( $self, $handle ) =3D @_;
>
>      my $remote_sockaddr =3D getpeername($handle);
> -    my ( undef, $iaddr ) =3D sockaddr_in($remote_sockaddr);
> +    my $iaddr;
> +    ( undef, $iaddr ) =3D sockaddr_in($remote_sockaddr) if
> + $remote_sockaddr;
>      my $local_sockaddr =3D getsockname($handle);
>      my ( undef, $localiaddr ) =3D sockaddr_in($local_sockaddr);
>
>      my $data =3D {
> -        peername =3D> gethostbyaddr( $iaddr, AF_INET ) || "localhost",
> -        peeraddr =3D> inet_ntoa($iaddr) || " 127.0.0.1",
> +       peername =3D> $iaddr ? gethostbyaddr( $iaddr, AF_INET ) :
> "localhost/Unknown",
> +       peeraddr =3D> $iaddr ? inet_ntoa($iaddr) : " 127.0.0.1/Unknown",
>          localname =3D> gethostbyaddr( $localiaddr, AF_INET ) ||
> "localhost",
>          localaddr =3D> inet_ntoa($localiaddr) || " 127.0.0.1",
>      };
>
>
> Jesper
> --
> Jesper Krogh
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
> Hi all.
>
> This is a small patch that makes the testserver survive Internet
> Explorer..
>
> This is probably not the correct fix.. since that would be to find out
> what the problem is.. Somehow it seems that the socket dissapears earlier
> when IE it in the other end.
>
> patch
> --- /usr/share/perl5/Catalyst/Engine/HTTP.pm    2006-07-19
> 23:45:16.000000000 +0200
> +++ lib/Catalyst/Engine/HTTP.pm 2006-10-03 11:43:42.000000000 +0200
> @@ -305,13 +305,14 @@
>      my ( $self, $handle ) =3D @_;
>
>      my $remote_sockaddr =3D getpeername($handle);
> -    my ( undef, $iaddr ) =3D sockaddr_in($remote_sockaddr);
> +    my $iaddr;
> +   ( undef, $iaddr ) =3D sockaddr_in($remote_sockaddr) if
> + $remote_sockaddr;
>      my $local_sockaddr =3D getsockname($handle);
>      my ( undef, $localiaddr ) =3D sockaddr_in($local_sockaddr);
>
>      my $data =3D {
> -        peername =3D> gethostbyaddr( $iaddr, AF_INET ) || "localhost",
> -        peeraddr =3D> inet_ntoa($iaddr) || " 127.0.0.1",
> +        peername =3D> $iaddr ? gethostbyaddr( $iaddr, AF_INET ) ||
> "localhost/Uknown",
> +        peeraddr =3D> $iaddr ? inet_ntoa($iaddr) : " 127.0.0.1/Unknown",
>          localname =3D> gethostbyaddr( $localiaddr, AF_INET ) ||
> "localhost",
>          localaddr =3D> inet_ntoa($localiaddr) || " 127.0.0.1",
>      };
>
>
> Stacktrace:
> Use of uninitialized value in subroutine entry
>         at Socket::sockaddr_in(/usr/lib/perl/5.8/Socket.pm:198)
>         at
> Catalyst::Engine::HTTP::_socket_data(/usr/share/perl5/Catalyst/Engine/HTT=
P.pm:308)
>
>         at
>
> Catalyst::Engine::HTTP::_handler(/usr/share/perl5/Catalyst/Engine/HTTP.pm=
:220)
>         at
> Catalyst::Engine::HTTP::run(/usr/share/perl5/Catalyst/Engine/HTTP.pm:172)
>         at Catalyst::run(/usr/share/perl5/Catalyst.pm:1754)
>         at main::(./script/nzdb_server.pl:54)
> Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16
>         at Socket::sockaddr_in(/usr/lib/perl/5.8/Socket.pm:198)
>         at
> Catalyst::Engine::HTTP::_socket_data(/usr/share/perl5/Catalyst/Engine/HTT=
P.pm:308)
>
>         at
>
> Catalyst::Engine::HTTP::_handler(/usr/share/perl5/Catalyst/Engine/HTTP.pm=
:220)
>         at
> Catalyst::Engine::HTTP::run(/usr/share/perl5/Catalyst/Engine/HTTP.pm:172)
>         at Catalyst::run(/usr/share/perl5/Catalyst.pm:1754)
>         at main::(./script/nzdb_server.pl:54)
>
> --
> Jesper Krogh
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
> ____________________________________________________
>  Hi,
> When I run catalyst, Sometime  I got below error:
> ------------------------------------------------------------------
> Use of uninitialized value in subroutine entry at
> /opt/perl/lib/5.8.6/i686-linux-thread-multi/Socket.pm line 370.
> Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16
> at /opt/perl/lib/5.8.6/i686-linux-thread-multi/Socket.pm line 370.
> -------------------------------------------------------------------
> This error takes place without regular. I can't find a way to reproduce
> this error.
> What's the rootcause? I try to find the answer by google but I was failed.
> Do you have advice on this?
>
> Thanks
> Mao Dengfeng
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jules.scsys.co.uk/pipermail/catalyst/attachments/20061110/d50b3=
bad/attachment.htm


More information about the Catalyst mailing list