[Bio] / FigKernelPackages / P2P.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/P2P.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23, Fri Jan 7 22:41:43 2005 UTC revision 1.24, Mon Jan 10 13:15:00 2005 UTC
# Line 18  Line 18 
18    
19  use FIG_Config;  use FIG_Config;
20    
21  use DB_File;  use AnyDBM_File;
22  use Fcntl;  use Fcntl;
23    
24  use strict;  use strict;
# Line 115  Line 115 
115      #      #
116      # We now know the data release for our peer.      # We now know the data release for our peer.
117      #      #
118      # Open up the peg translation cache database (a DB_File) tied      # Open up the peg translation cache database (a AnyDBM_File) tied
119      # to %peg_cache. We needn't worry about keeping it in a directory      # to %peg_cache. We needn't worry about keeping it in a directory
120      # based on our current release, as it the cache directory is kept *in*      # based on our current release, as it the cache directory is kept *in*
121      # the current data release directory.      # the current data release directory.
# Line 129  Line 129 
129          my $cache_dir = "$FIG_Config::data/P2PQueue";          my $cache_dir = "$FIG_Config::data/P2PQueue";
130          $fig->verify_dir($cache_dir);          $fig->verify_dir($cache_dir);
131    
132          $cache_handle = tie(%peg_cache, "DB_File", "$cache_dir/$cache_file",          $cache_handle = tie(%peg_cache, "AnyDBM_File", "$cache_dir/$cache_file",
133                              O_CREAT | O_RDWR, 0666, $DB_HASH);                              O_CREAT | O_RDWR, 0666);
134          $cache_handle or warn "Could not tie peg_cache to $cache_dir/$cache_file: $!\n";          $cache_handle or warn "Could not tie peg_cache to $cache_dir/$cache_file: $!\n";
135      }      }
136    
# Line 148  Line 148 
148      _compute_peg_mapping($fig, $peer, $session, $num_pegs, \%peg_mapping, \%peg_cache, $cache_handle,      _compute_peg_mapping($fig, $peer, $session, $num_pegs, \%peg_mapping, \%peg_cache, $cache_handle,
149                           $skip_tough_search);                           $skip_tough_search);
150    
151      $cache_handle->sync();      eval { $cache_handle->sync();};
152      untie %peg_cache;      untie %peg_cache;
153    
154      #      #
# Line 442  Line 442 
442  # $session      P2P session ID  # $session      P2P session ID
443  # $peg_mapping  Hash ref for the remote -> local PEG mapping  # $peg_mapping  Hash ref for the remote -> local PEG mapping
444  # $peg_cache    Hash ref for the persistent remote -> local PEG mapping cache db.  # $peg_cache    Hash ref for the persistent remote -> local PEG mapping cache db.
445  # $cache_handle DB_File handle corresponding to $peg_cache.  # $cache_handle AnyDBM_File handle corresponding to $peg_cache.
446  #  #
447  sub _compute_peg_mapping  sub _compute_peg_mapping
448  {  {
# Line 665  Line 665 
665      #      #
666      # Flush the cache to write out any computed mappings.      # Flush the cache to write out any computed mappings.
667      #      #
668      $cache_handle->sync();      eval { $cache_handle->sync();};
669    
670  }  }
671    
# Line 814  Line 814 
814  {  {
815      my($class, $url) = @_;      my($class, $url) = @_;
816    
817      my $proxy = SOAP::Lite->uri($P2P::ns_relay)->proxy($url);      my $creds = ['seed-linux-2.uchicago.edu:80',
818                     'SEED User',
819                     annotator => 'anno4all'];
820    
821        my $proxy = SOAP::Lite->uri($P2P::ns_relay)->proxy([$url,
822                                                            credentials => $creds]);
823    
824      my $self = {      my $self = {
825          url => $url,          url => $url,
# Line 948  Line 953 
953    
954  sub new  sub new
955  {  {
956      my($class, $fig, $url, $peer_id, $relay) = @_;      my($class, $fig, $url, $peer_id, $relay, $credentials) = @_;
957    
958        $credentials = [] unless ref($credentials);
959    
960      my $proxy = SOAP::Lite->uri($ns_p2p)->proxy($url, timeout => 3600);      my $proxy = SOAP::Lite->uri($ns_p2p)->proxy($url, timeout => 3600,
961                                                    credentials => $credentials);
962    
963      my $self = {      my $self = {
964          fig => $fig,          fig => $fig,

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3