Changeset 688

Show
Ignore:
Timestamp:
07/18/07 21:22:02 (1 year ago)
Author:
kindlund
Message:

Testing… make sure the Flash code doesn't use a global url hashtable (that's bad).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/branches/exp/jpuchalski-active_content/lib/HoneyClient/Agent/Driver/ActiveContent/Flash.pm

    r687 r688  
    124124our $base_url; 
    125125 
    126 # Put all the relative URLs that were retrieved into a hash as 
    127 # keys, but first turn them into full URLs.  Set the value for 
    128 # each URL key to 1 (this is its score). 
    129 our %urls; 
    130  
    131126 
    132127####################################################################### 
     
    138133=head1 PRIVATE METHODS 
    139134 
    140 =head2 HoneyClient::Agent::Driver::ActiveContent::Flash->_addURL($url
     135=head2 HoneyClient::Agent::Driver::ActiveContent::Flash->_addURL($url, $urls
    141136 
    142137=over 4 
     
    151146 
    152147sub _addURL { 
    153     my $url = shift; 
     148    # Extract arguments.     
     149    my ($url, $urls) = @_; 
    154150 
    155151    # URL appears to be absolute, or a different protocol 
     
    157153        $url =~ /^javascript/ or 
    158154        $url =~ /^http/) { 
    159         $urls{$url} = 1; 
     155        $urls->{$url} = 1; 
    160156    } 
    161157    # URL appears to be relative, so add the base 
    162158    else { 
    163159        $url = url($url, $base_url)->abs; 
    164         $urls{$url} = 1; 
    165     } 
     160        $urls->{$url} = 1; 
     161    } 
     162    return $urls; 
    166163} 
    167164 
     
    211208    }); 
    212209 
     210    # Put all the relative URLs that were retrieved into a hash as 
     211    # keys, but first turn them into full URLs.  Set the value for 
     212    # each URL key to 1 (this is its score). 
     213    my $urls = {}; 
     214 
    213215    my $filename = $args{'file'}->filename; 
    214216 
     
    262264 
    263265    foreach (@found_urls) { 
    264         _addURL($_); 
     266        $urls = _addURL($_, $urls); 
    265267    } 
    266268 
     
    272274    # We can exit here if there are no getURL2 calls 
    273275    unless (grep(/getURL2/, @bytecode)) { 
    274         return %urls
     276        return %{$urls}
    275277    } 
    276278  
     
    325327                        $LOG->info("Value of the URL is $val"); 
    326328                        $val =~ s/'//g; 
    327                         _addURL($val); 
     329                        $urls = _addURL($val, $urls); 
    328330                    } 
    329331                    last; 
     
    335337    } 
    336338 
    337     return %urls
     339    return %{$urls}
    338340} 
    339341 
  • honeyclient/branches/exp/jpuchalski-active_content/lib/HoneyClient/Agent/Driver/Browser.pm

    r668 r688  
    10651065                            ); 
    10661066 
     1067# XXX: Delete this. 
     1068use Data::Dumper; 
     1069$Data::Dumper::Terse = 0; 
     1070$Data::Dumper::Indent = 1; 
     1071print "scored_links = " . Dumper(%scored_links) . "\n"; 
     1072 
    10671073        # Assume that all other content types are HTML-based. 
    10681074        } else {