Ignore:
Timestamp:
Jan 28, 2006, 4:05:20 AM (16 years ago)
Author:
titer
Message:

Ignore requests for blocks we don't have, fixes the "readOrWrite ..." error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peermessages.h

    r3 r54  
    6060        /* We need to load the block for the next request */
    6161        r = &peer->outRequests[0];
     62
     63        /* Sanity check */
     64        if( !tr_cpPieceIsComplete( tor->completion, r->index ) )
     65        {
     66            /* We have been asked for something we don't have, buggy client?
     67               Let's just drop this request */
     68            tr_inf( "Block %d/%d/%d was requested but we don't have it",
     69                    r->index, r->begin, r->length );
     70            (peer->outRequestCount)--;
     71            memmove( &peer->outRequests[0], &peer->outRequests[1],
     72                     peer->outRequestCount * sizeof( tr_request_t ) );
     73            return NULL;
     74        }
     75       
    6276        p = (uint8_t *) peer->outBlock;
    6377
Note: See TracChangeset for help on using the changeset viewer.