668669670671672673674675676677678679680
bb.get( contents ); }else if ( message_id.equals( BTMessage.ID_BT_HAVE )){ BTHave have = (BTHave)message; if ( have.getPieceNumber() == num_pieces ){ synchronized( sessions ){ closing = true; }
783784785786787788789790791792793
protected void sendHave( int piece_number ) { BTHave message = new BTHave( piece_number, BTMessageFactory.MESSAGE_VERSION_INITIAL ); OutgoingMessageQueue out_q = connection.getOutgoingMessageQueue(); out_q.addMessage( message, false );
705706707708709710711712713714715
// kinda crappy as it triggers on first block of piece, however better // than nothing piece_map.set( piece_number ); decoder.addMessage( new BTHave( piece_number, (byte)1 )); } buffers[1] = this_piece.getPieceData(); req.logQueued();