Changeset 610


Ignore:
Timestamp:
Oct 10, 2013, 2:20:30 PM (9 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Cleanup on some configuration for RPC and FastCGI

Location:
branches/stable/cgi-bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/IPDB.pm

    r605 r610  
    2424@EXPORT_OK    = qw(
    2525        %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist
    26         %IPDBacl %aclmsg %rpcacl
     26        %IPDBacl %aclmsg %rpcacl $maxfcgi
    2727        &initIPDBGlobals &connectDB &finish &checkDBSanity
    2828        &addMaster &touchMaster
     
    3838%EXPORT_TAGS    = ( ALL => [qw(
    3939                %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist
    40                 %IPDBacl %aclmsg %rpcacl
     40                %IPDBacl %aclmsg %rpcacl $maxfcgi
    4141                &initIPDBGlobals &connectDB &finish &checkDBSanity
    4242                &addMaster &touchMaster
     
    6969
    7070our %rpcacl;
     71our $maxfcgi = 3;
    7172
    7273our $org_name = 'Example Corp';
  • branches/stable/cgi-bin/MyIPDB.pm

    r601 r610  
    2929#       devel => ['10.0.10.5'],
    3030#       );
     31# Only you can prevent memory leaks!
     32#$IPDB::maxfcgi = 100;
    3133
    3234# Quick workaround for fixed web path.  Set this to the absolute web path to
  • branches/stable/cgi-bin/ipdb-rpc.cgi

    • Property svn:keywords set to Date Rev Author Id
    r600 r610  
    3737}
    3838
    39 syslog "debug", "$authuser active, $ENV{'REMOTE_ADDR'}";
    40 
    4139# Why not a global DB handle?  (And a global statement handle, as well...)
    4240# Use the connectDB function, otherwise we end up confusing ourselves
     
    5755# main FCGI loop.
    5856while (FCGI::accept >= 0) {
     57  # done here to a) prevent $ENV{'REMOTE_ADDR'} from being empty and b) to collect
     58  # the right user for the individual call (since we may be running with FCGI)
     59  syslog "debug", "$authuser active, $ENV{'REMOTE_ADDR'}";
     60
    5961  # don't *think* we need any of these...
    6062  # %disp_alloctypes, %def_custids, %list_alloctypes
     
    7476    print $res->answer;
    7577  }
    76 #  last if $reqcnt++ > $IPDB::maxfcgi;
     78  last if $reqcnt++ > $IPDB::maxfcgi;
    7779} # while FCGI::accept
    7880
     
    8789sub _aclcheck {
    8890  my $subsys = shift;
    89   return 1;
    90   return 1 if grep /$ENV{REMOTE_ADDR}/, $IPDB::rpcacl{$subsys};
     91  return 1 if grep /$ENV{REMOTE_ADDR}/, @{$IPDB::rpcacl{$subsys}};
    9192  warn "$subsys/$ENV{REMOTE_ADDR} not in ACL\n";        # a bit of logging
    9293  return 0;
Note: See TracChangeset for help on using the changeset viewer.