($myownurl) = gethostbyname($myownurl);
$myownurl = "http://".$myownurl.":".$myownport;
-tie(%map, 'DB_File', $uris_dbm.".db", O_RDONLY, 0664);
+tie(%map, 'DB_File', $uris_dbm.".db", O_RDWR, 0664);
print "Please contact me at: <URL:", $myownurl."/", ">\n";
print "helm_dir: $helm_dir\n";
print "style_dir: $style_dir\n";
answer($c,$ciccontent,"text/xml","x-gzip");
}
}
+ } elsif ($http_method eq 'GET' and $http_path eq "/register") {
+ my $inputurl = $cgi->param('url');
+ print "Register requested...\n";
+ $map{$inputuri}=$inputurl;
+
+ # Now let's clean the cache
+ my $cicfilename = $inputuri;
+ $cicfilename =~ s/cic:(.*)/$1/;
+ $cicfilename =~ s/theory:(.*)/$1/;
+
+ print "Unlinking ".$helm_dir.$cicfilename.".xml[.gz]\n";
+ unlink ($helm_dir.$cicfilename.".xml");
+ unlink ($helm_dir.$cicfilename.".xml.gz");
+
+ kill(USR1,getppid()); # signal changes to parent
+ untie %map;
+ print "done\n";
+ html_nice_answer($c,"Register done");
} elsif ($http_method eq 'GET' and $http_path eq "/resolve") {
my $outputurl = $map{$inputuri};
$outputurl = "" if (not defined($outputurl));
sub update {
untie %map;
- tie(%map, 'DB_File', $uris_dbm.".db", O_RDONLY, 0664);
+ tie(%map, 'DB_File', $uris_dbm.".db", O_RDWR, 0664);
}
sub mk_urls_of_uris {
}
untie(%urls_of_uris);
- tie(%map, 'DB_File', $uris_dbm.".db", O_RDONLY, 0664);
+ tie(%map, 'DB_File', $uris_dbm.".db", O_RDWR, 0664);
}