Menu

qtella drops valid query hits ?

Developers
2002-10-08
2002-10-08
  • Joris Beugnies

    Joris Beugnies - 2002-10-08

    While playing with qtella I stumbled on the fact that qtella drops
    valid queryhits iso duplicate ones. (qtella-0.5.4)

    I have qtella connecting to 1 server with ip 192.168.1.254 
    This is the only comunication going on at all since startup:
    ( > = server to qtella, < = qtella to server )

    < ping
    > pong 192.168.1.254:6346, 10 files, 124 kbytes
    < query (0 kbps) 'file'
    > hit 192.168.1.254:8080 (350 kbps) 10 hits
        00000000 12345 'file0000.avi'
        00000001 12365 'file0001.avi'
        00000002 12385 'file0002.avi'
        00000003 12405 'file0003.avi'
        00000004 12425 'file0004.avi'
        00000005 12445 'file0005.avi'
        00000006 12465 'file0006.avi'
        00000007 12485 'file0007.avi'
        00000008 12505 'file0008.avi'
        00000009 12525 'file0009.avi'

    now the only thing that gets displayed by qtella in
    the list is 'file0000.avi'

    de rest is filtered out by a statement in Connections.cpp,
    where the QUERYHIT is parsed.

    if( _search[pos]->duplicate( q->_address.longIP(), q->_results[n] ) )
        continue;

    I guess the idea is to filter out duplicate hits/filenames comming from the same ip,

    so in that case the problem is in Search::duplicate

    I fixed the function in this way and tested it (also with duplicate names ) which gives now the desired result.

    const bool Search::duplicate( const Q_UINT32 ip, const QueryResult& qr )
    {

         if (
                    ( _multiple_filter.find( ip ) != _multiple_filter.end() ) &&
                    ( _multiple_filter[ip].find( qr._filename ) !=
                     _multiple_filter[ip].end() )
               )
                    return true;

            _multiple_filter[ip].insert( qr._filename );
            return false;

    }

    kind regards,

    Joris

    (ps. while filtering out based on the name only does the trick in most cases I wonder if it not be more correct to check and store the whole result )

     
    • Daniel Etzold

      Daniel Etzold - 2002-10-08

      Hi,
      I have fixed the problem. Thanks.

      I have also thought about replacing the name by some kind of a checksum over most of the fields in QueryResult and I think I will do so in the future.

      Regards,
      Daniel

       

Log in to post a comment.