Changeset 1082

Show
Ignore:
Timestamp:
12/18/07 14:11:35 (9 months ago)
Author:
xkovah
Message:

This should fix the issue with max_relative_links_to_visit so that it behaves correctly for 0, 1, and > 1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/trunk/lib/HoneyClient/Agent/Driver/Browser.pm

    r1080 r1082  
    11171117    # Check to see if the request timed out. 
    11181118    # TODO: Need better error detection. 
    1119     if (!%scored_links) { 
     1119    if (!defined($content)) { 
    11201120        $self->links_timed_out->{$args{'url'}} = $timestamp; 
    11211121 
     
    11301130        $self->links_visited->{$args{'url'}} = $timestamp; 
    11311131 
    1132         # Add all links found on this page to our sorted queues. 
    1133         # This function modifies the $self object internally and its 
    1134         # returned content does not need to be checked. 
    1135         $self->_processLinks($args{'url'}, %scored_links); 
     1132        if(%scored_links){ 
     1133            # Add all links found on this page to our sorted queues. 
     1134            # This function modifies the $self object internally and its 
     1135            # returned content does not need to be checked. 
     1136            $self->_processLinks($args{'url'}, %scored_links); 
     1137        } 
    11361138    } 
    11371139     
    11381140    # Check our internal relative links counter. 
    1139     if (($self->_remaining_number_of_relative_links_to_visit == 0) || 
    1140         ($self->_remaining_number_of_relative_links_to_visit == 1)) { 
     1141    if (($self->_remaining_number_of_relative_links_to_visit == 0)){ 
    11411142 
    11421143        # XXX: Do we need this message in here? 
     
    11501151        $self->{_remaining_number_of_relative_links_to_visit} = 
    11511152            $self->max_relative_links_to_visit; 
    1152     } elsif ($self->_remaining_number_of_relative_links_to_visit > 1) { 
     1153    } elsif ($self->_remaining_number_of_relative_links_to_visit >= 1) { 
    11531154 
    11541155        # The counter is positive, so decrement it.