Quoting Christian Biere <[EMAIL PROTECTED]> from ml.softs.gtk-gnutella.devel:
:Bill Pringlemeir wrote:
:> qrt_build_query_target() has the following lines...
:
:>         if (is_leaf) {
:>             /* Leaf node */
:>             if (rt == NULL)             /* No QRT yet */
:>                 continue;               /* Don't send anything */
:
:This is actually wrong. Leaves that don't support query routing
:should always get the query.

Actually, the logic I favoured is: all leaves MUST support QRT (by definition
of a leaf node), and a leaf which has not send a QRT yet should not get
the query because:

1. This uses b/w at the UP level for slow leaves that have a huge QRT or
   which send their QRT slowly.
2. Buggy leaves which choose to not implement QRT may still connect and
   search the network but they will get no query.  Yes, this makes them
   leaches, but the alternative is worse (see #1).

:> I think the last two translate to,
: 
:>             if(!(ttl == 1))      /* (ttl != 1) */ 
:>                 continue;
:>             if(ttl == 0)         /* TTL must be one here? */
:>                 continue;
:
:> Maybe I am up too late ;-).  I guess the second test never needs to be
:> made.  However, it doesn't look like we would forward query requests
:> with a TTL greater than one?  Is this impossible to have a ttl greater
:> than one?
:
:The second check is indeed unnecessary. Queries with a TTL greater
:than one are handled by the calling function. It's a bit hard to
:follow the code though albeit the routing scheme is not really that
:complex.

The routine has undergone recent refactoring (before 0.96b was released)
which made the above flaw apparent.  I'm glad this code gets peer-reviewed
because it is easy to make mistakes.

During the refactoring I did, I was careful to respect the logic already
in place, but did not attempt to double-check the logic.

I fixed the code in CVS, thanks.

Raphael


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Gtk-gnutella-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to