From: <buc...@us...> - 2011-04-04 10:40:53
|
Revision: 223 http://devmon.svn.sourceforge.net/devmon/?rev=223&view=rev Author: buchanmilne Date: 2011-04-04 10:40:46 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Correct some exception messages, and provide more detail of messages being sent to display server Modified Paths: -------------- trunk/modules/dm_msg.pm Modified: trunk/modules/dm_msg.pm =================================================================== --- trunk/modules/dm_msg.pm 2011-04-04 10:32:02 UTC (rev 222) +++ trunk/modules/dm_msg.pm 2011-04-04 10:40:46 UTC (rev 223) @@ -63,13 +63,13 @@ # Open our socket to the host do_log("DEBUG: Opening socket to $host:$g{'dispport'}",3) if $g{'debug'}; eval { - local $SIG{ALRM} = sub { die "Socket timed out" }; + local $SIG{ALRM} = sub { die "Socket timed out\n" }; alarm 10; socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or do_log("Failed to create socket ($!)",0) and $g{'msgxfrtime'} = time - $g{'msgxfrtime'} and return; alarm 0; - local $SIG{ALRM} = sub { die "Connect timed out" }; + local $SIG{ALRM} = sub { die "Connect timed out\n" }; alarm 10; if (!connect(SOCK, $p_addr)) { do_log("Can't connect to display server $host ($!)",0); @@ -86,7 +86,7 @@ # Tell the display server that we are sending a combo msg eval { - local $SIG{ALRM} = sub { die "Print timed out" }; + local $SIG{ALRM} = sub { die "Print timed out\n" }; alarm 10; print SOCK "combo\n"; alarm 0; @@ -115,16 +115,18 @@ # Nuts, this is a huge message, bigger than our msg size. Well want # to send it by itself to minimize how much it gets truncated if($msg_size == 0) { - do_log("DEBUG: Printing single combo message",3) if $g{'debug'}; + my $thismsgsize = length $msg; # Okay, we are clear, send the message eval { - local $SIG{ALRM} = sub { die "Printing message timed out" }; + local $SIG{ALRM} = sub { die "Printing message timed out\n" }; alarm 10; + do_log("DEBUG: Printing single combo message size $thismsgsize",3) if $g{'debug'}; print SOCK "$msg\n"; + do_log("DEBUG: Finished printing single combo message",3) if $g{'debug'}; alarm 0; }; if ($@) { - do_log("Timed out printing to display server: $!",0); + do_log("Timed out printing to display server: $@ - $!",0); close SOCK; return; } @@ -154,7 +156,7 @@ else { do_log("DEBUG: Printing combo message with multiple messages",3) if $g{'debug'}; eval { - local $SIG{ALRM} = sub { die "Printing message timed out" }; + local $SIG{ALRM} = sub { die "Printing message timed out\n" }; alarm 10; print SOCK "$msg\n"; alarm 0; @@ -165,6 +167,7 @@ return; } $msg_size += length $msg; + do_log("DEBUG: Finished printing combo message with multiple messages",3) if $g{'debug'}; } } # End MSGLOOP @@ -180,7 +183,7 @@ do_log("DEBUG: Connecting and sending dm message",3) if $g{'debug'}; my $dm_msg = dm_stat_msg(); eval { - local $SIG{ALRM} = sub { die "Connecting and sending dm message timed out" }; + local $SIG{ALRM} = sub { die "Connecting and sending dm message timed out\n" }; alarm 10; socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or do_log("Failed to create socket ($!)",0) and return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |