version 1.127, 2003/01/14 01:42:52
|
version 1.130, 2003/01/14 18:47:50
|
Line 46 use Apache::Constants qw(:common :http);
|
Line 46 use Apache::Constants qw(:common :http);
|
use Apache::loncommon(); |
use Apache::loncommon(); |
use POSIX qw (floor strftime); |
use POSIX qw (floor strftime); |
|
|
|
my %navmaphash; |
|
my %parmhash; |
|
|
|
sub cleanup { |
|
if (tied(%navmaphash)){ |
|
&Apache::lonnet::logthis('Cleanup navmaps: navmaphash'); |
|
unless (untie(%navmaphash)) { |
|
&Apache::lonnet::logthis('Failed cleanup navmaps: navmaphash'); |
|
} |
|
} |
|
if (tied(%parmhash)){ |
|
&Apache::lonnet::logthis('Cleanup navmaps: parmhash'); |
|
unless (untie(%parmhash)) { |
|
&Apache::lonnet::logthis('Failed cleanup navmaps: parmhash'); |
|
} |
|
} |
|
} |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
real_handler($r); |
real_handler($r); |
Line 688 sub real_handler {
|
Line 706 sub real_handler {
|
|
|
$navmap->untieHashes(); |
$navmap->untieHashes(); |
|
|
$r->print("<h1>Untied Hashes</h1></body></html>"); |
$r->print("</body></html>"); |
|
|
return OK; |
return OK; |
} |
} |
Line 985 sub new {
|
Line 1003 sub new {
|
$self->{NETWORK_FAILURE} = 0; |
$self->{NETWORK_FAILURE} = 0; |
|
|
# tie the nav hash |
# tie the nav hash |
my %navmaphash; |
|
if (!(tie(%navmaphash, 'GDBM_File', $self->{NAV_HASH_FILE}, |
if (!(tie(%navmaphash, 'GDBM_File', $self->{NAV_HASH_FILE}, |
&GDBM_READER(), 0640))) { |
&GDBM_READER(), 0640))) { |
return undef; |
return undef; |
} |
} |
|
|
my %parmhash; |
|
if (!(tie(%parmhash, 'GDBM_File', $self->{PARM_HASH_FILE}, |
if (!(tie(%parmhash, 'GDBM_File', $self->{PARM_HASH_FILE}, |
&GDBM_READER(), 0640))) |
&GDBM_READER(), 0640))) |
{ |
{ |
Line 999 sub new {
|
Line 1016 sub new {
|
return undef; |
return undef; |
} |
} |
|
|
|
$self->{HASH_TIED} = 1; |
$self->{NAV_HASH} = \%navmaphash; |
$self->{NAV_HASH} = \%navmaphash; |
$self->{PARM_HASH} = \%parmhash; |
$self->{PARM_HASH} = \%parmhash; |
|
|
bless($self); |
bless($self); |
$self->untieHashes(); |
|
|
|
return $self; |
return $self; |
} |
} |