r3833 - in branches/nexuiz-2.0: . Docs/server/rcon2irc data

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Jul 15 05:16:57 EDT 2008


Author: div0
Date: 2008-07-15 05:16:47 -0400 (Tue, 15 Jul 2008)
New Revision: 3833

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/Docs/server/rcon2irc/rcon2irc.pl
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
Log:
r3831 | div0 | 2008-07-15 11:06:17 +0200 (Tue, 15 Jul 2008) | 2 lines
try to handle read errors
r3832 | div0 | 2008-07-15 11:13:04 +0200 (Tue, 15 Jul 2008) | 3 lines
prvm_leaktest_ignore_classnames "ctf_team dom_team tdm_team"
(these are not actual leaks)

Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2008-07-15 09:13:04 UTC (rev 3832)
+++ branches/nexuiz-2.0/.patchsets	2008-07-15 09:16:47 UTC (rev 3833)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-3760,3762-3773,3777-3778,3787-3788,3790-3790,3796-3804,3807-3808,3817-3817,3822-3825,3828-3829
+revisions_applied = 1-3760,3762-3773,3777-3778,3787-3788,3790-3790,3796-3804,3807-3808,3817-3817,3822-3825,3828-3832

Modified: branches/nexuiz-2.0/Docs/server/rcon2irc/rcon2irc.pl
===================================================================
--- branches/nexuiz-2.0/Docs/server/rcon2irc/rcon2irc.pl	2008-07-15 09:13:04 UTC (rev 3832)
+++ branches/nexuiz-2.0/Docs/server/rcon2irc/rcon2irc.pl	2008-07-15 09:16:47 UTC (rev 3833)
@@ -122,8 +122,18 @@
 {
 	my ($self) = @_;
 	my $data = "";
-	$self->{sock}->recv($data, 32768, 0);
-	return $data;
+	if(defined $self->{sock}->recv($data, 32768, 0))
+	{
+		return $data;
+	}
+	elsif($!{EAGAIN})
+	{
+		return "";
+	}
+	else
+	{
+		return undef;
+	}
 }
 
 # $sock->fds() returns the socket file descriptor.
@@ -245,7 +255,10 @@
 	my ($self) = @_;
 	for(;;)
 	{
-		length(my $s = $self->{connector}->recv())
+		my $s = $self->{connector}->recv();
+		die "read error\n"
+			if not defined $s;
+		length $s
 			or last;
 		next
 			if $s !~ /^\377\377\377\377n(.*)$/s;
@@ -352,7 +365,10 @@
 	my ($self) = @_;
 	for(;;)
 	{
-		length(my $s = $self->{connector}->recv())
+		my $s = $self->{connector}->recv()
+		die "read error\n"
+			if not defined $s;
+		length $s
 			or last;
 		$self->{recvbuf} .= $s;
 	}
@@ -1306,37 +1322,52 @@
 			}
 		}
 
-		for my $line($chan->recv())
+		eval
 		{
-			# found one! Check if it matches the regular expression of one of
-			# our handlers...
-			my $handled = 0;
-			for my $h(@handlers)
+			for my $line($chan->recv())
 			{
-				my ($chanstr_wanted, $re, $sub) = @$h;
-				next
-					if $chanstr_wanted ne $chanstr;
-				use re 'eval';
-				my @matches = ($line =~ /^$re$/s);
-				no re 'eval';
-				next
-					unless @matches;
-				# and if it is a match, handle it.
-				++$handled;
-				my $result = $sub->(@matches);
-				last
-					if $result;
+				# found one! Check if it matches the regular expression of one of
+				# our handlers...
+				my $handled = 0;
+				for my $h(@handlers)
+				{
+					my ($chanstr_wanted, $re, $sub) = @$h;
+					next
+						if $chanstr_wanted ne $chanstr;
+					use re 'eval';
+					my @matches = ($line =~ /^$re$/s);
+					no re 'eval';
+					next
+						unless @matches;
+					# and if it is a match, handle it.
+					++$handled;
+					my $result = $sub->(@matches);
+					last
+						if $result;
+				}
+				# print the message, together with info on whether it has been handled or not
+				if($handled)
+				{
+					print "           $chanstr >> $line\n";
+				}
+				else
+				{
+					print "unhandled: $chanstr >> $line\n";
+				}
 			}
-			# print the message, together with info on whether it has been handled or not
-			if($handled)
+			1;
+		} or do {
+			if($@ eq "read error\n")
 			{
-				print "           $chanstr >> $line\n";
+				$channels{system}->send("error $chanstr", 0);
+				next CHANNEL;
 			}
 			else
 			{
-				print "unhandled: $chanstr >> $line\n";
+				# re-throw
+				die $@;
 			}
-		}
+		};
 	}
 
 	# handle scheduled tasks...

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2008-07-15 09:13:04 UTC (rev 3832)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2008-07-15 09:16:47 UTC (rev 3833)
@@ -1041,3 +1041,7 @@
 set sv_maxidle 0
 // when sv_maxidle is not 0, assume spectators are idle too
 set sv_maxidle_spectatorsareidle 0
+
+// these entities are not referenced by anything directly, they just represent
+// teams and are found by find() when needed
+prvm_leaktest_ignore_classnames "ctf_team dom_team tdm_team"




More information about the nexuiz-commits mailing list