Index: branches/stable/cgi-bin/IPDB.pm
===================================================================
--- branches/stable/cgi-bin/IPDB.pm	(revision 606)
+++ branches/stable/cgi-bin/IPDB.pm	(revision 610)
@@ -24,5 +24,5 @@
 @EXPORT_OK    = qw(
 	%disp_alloctypes %list_alloctypes %def_custids @citylist @poplist
-	%IPDBacl %aclmsg %rpcacl
+	%IPDBacl %aclmsg %rpcacl $maxfcgi
 	&initIPDBGlobals &connectDB &finish &checkDBSanity
 	&addMaster &touchMaster
@@ -38,5 +38,5 @@
 %EXPORT_TAGS	= ( ALL => [qw(
 		%disp_alloctypes %list_alloctypes %def_custids @citylist @poplist
-		%IPDBacl %aclmsg %rpcacl
+		%IPDBacl %aclmsg %rpcacl $maxfcgi
 		&initIPDBGlobals &connectDB &finish &checkDBSanity
 		&addMaster &touchMaster
@@ -69,4 +69,5 @@
 
 our %rpcacl;
+our $maxfcgi = 3;
 
 our $org_name = 'Example Corp';
Index: branches/stable/cgi-bin/MyIPDB.pm
===================================================================
--- branches/stable/cgi-bin/MyIPDB.pm	(revision 606)
+++ branches/stable/cgi-bin/MyIPDB.pm	(revision 610)
@@ -29,4 +29,6 @@
 #	devel => ['10.0.10.5'],
 #	);
+# Only you can prevent memory leaks!
+#$IPDB::maxfcgi = 100;
 
 # Quick workaround for fixed web path.  Set this to the absolute web path to
Index: branches/stable/cgi-bin/ipdb-rpc.cgi
===================================================================
--- branches/stable/cgi-bin/ipdb-rpc.cgi	(revision 606)
+++ branches/stable/cgi-bin/ipdb-rpc.cgi	(revision 610)
@@ -37,6 +37,4 @@
 }
 
-syslog "debug", "$authuser active, $ENV{'REMOTE_ADDR'}";
-
 # Why not a global DB handle?  (And a global statement handle, as well...)
 # Use the connectDB function, otherwise we end up confusing ourselves
@@ -57,4 +55,8 @@
 # main FCGI loop.
 while (FCGI::accept >= 0) {
+  # done here to a) prevent $ENV{'REMOTE_ADDR'} from being empty and b) to collect
+  # the right user for the individual call (since we may be running with FCGI)
+  syslog "debug", "$authuser active, $ENV{'REMOTE_ADDR'}";
+
   # don't *think* we need any of these...
   # %disp_alloctypes, %def_custids, %list_alloctypes
@@ -74,5 +76,5 @@
     print $res->answer;
   }
-#  last if $reqcnt++ > $IPDB::maxfcgi;
+  last if $reqcnt++ > $IPDB::maxfcgi;
 } # while FCGI::accept
 
@@ -87,6 +89,5 @@
 sub _aclcheck {
   my $subsys = shift;
-  return 1;
-  return 1 if grep /$ENV{REMOTE_ADDR}/, $IPDB::rpcacl{$subsys};
+  return 1 if grep /$ENV{REMOTE_ADDR}/, @{$IPDB::rpcacl{$subsys}};
   warn "$subsys/$ENV{REMOTE_ADDR} not in ACL\n";        # a bit of logging
   return 0;
