in reply to Re: Re: Re: Re: HTTP::Daemon aborting in send_status_line?
in thread HTTP::Daemon aborting in send_status_line?

The program does not hang (block) on the print statement, it stops at it (dies without raising an exception).
Perhaps you're getting a "broken pipe" exception. Quote from Lincoln Stein's book "Network Programming in Perl":
The PIPE signal is sent when a program writes to a pipe or socket but the process at the remote end has either exited or closed the pipe.

Try setting a $SIG{PIPE} handler to an error reporting sub.

  • Comment on Re(5): HTTP::Daemon aborting in send_status_line?

Replies are listed 'Best First'.
Re: Re(5): HTTP::Daemon aborting in send_status_line?
by mifflin (Curate) on Apr 23, 2004 at 15:46 UTC
    GOOD catch!

    I put a sigpipe handler in and voila!
    no more ugly program aborting

    thanks

    sub send_http_resp { print "$$ begin: send_http_resp\n" if $verbose; my ($client, $content) = @_; local $SIG{PIPE} = sub { print "$$ SIGPIPE\n" }; eval { my $header = HTTP::Headers->new('Content-Type' => 'text/xml; cha +rset=utf-8'); print "$$ send_http_resp : created a new HTTP::Headers object\n" + if $verbose; my $response = HTTP::Response->new(200, 'OK', $header, $content) +; print "$$ send_http_resp : created a new HTTP::Response object\n +" if $verbose; $client->send_response($response); print "$$ send_http_resp OK\n" if $verbose; }; if ($@) { print "$$ caught http exception: $@\n" if $verbose; } print "$$ end: send_http_resp\n" if $verbose; }