On Jan 11, 2008, at 10:50 AM, Matthew Toseland wrote:

Log:
trivial: comments, logging, readability

Doesn't look that way to me e.g. timeAllSent affects when we kill the
transfer. What's going on here?

There was more than one problem with timeAllSent... there are a number
of commits regarding the block transmittion/reception. This change
actually is trivial because the only time that timeAllSent was set is
on breaking out of the loop, so I moved it to the break statement so
that one can see that.

And what about removing else if(_allSent) { ... return } ?

It was already checked before that conditional statement so I replaced it with an unknown-message check:

if (_sendComplete)
        return;

if (msg==this_type) {
        do(that_thing);
} else if (msg==that_type)
        do(the_other_thing);
} else if (_sendComplete) {
        return;
}

But... even the first check is ultimately removed in r17004 to make _sendComplete *only* a signal from the blocking-send() thread to the _senderThread; eliminating a major race condition (if _senderThread was the first to notice that (1) client disconnected, or (2) prb aborted, all that the send() thread knew was "_sendComplete", when if it would just loop again it would notice the exact condition itself).

It may be easier to read the final version of the transmitter / receiver, they are a lot more readable now, and I tested them with 10% packet loss and they worked fine.

--
Robert Hailey
_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to