4 Nov 22:08
Re: DC++ incompatibility
Robin Hill <robin <at> robinhill.me.uk>
2004-11-04 21:08:49 GMT
2004-11-04 21:08:49 GMT
On Thu Nov 04, 2004 at 09:00:11PM +0100, Tommy Thorsen wrote: > The background for this mail is the problem described in (at least) two > threads in the forum, namely: > http://dcgui.berlios.de/forum/viewtopic.php?t=2363 > and > http://dcgui.berlios.de/forum/viewtopic.php?t=2538 > > I've posted using the name SuperTommy. > > The function CDownloadManager::DM_TransferCallBack() in the file > "cdownloadmanager.cpp" (line 3785 onwards, from "case DC_MESSAGE_KEY:") > contains some code where the hierarchy of if's looks like this pseudo-code: > > 01: if ( Transfer->GetDstDirection() == Transfer->GetSrcDirection() ) > 02: { > 03: if ( Transfer->GetDstLevel() < Transfer->GetSrcLevel() ) > 04: { > 05: if ( Transfer->GetSrcDirection() == edDOWNLOAD ) > 06: { > 07: <change DstDirection to edUPLOAD> > 08: } > 09: else if ( Transfer->GetSrcDirection() == edUPLOAD ) > 10: { > 11: <change DstDirection to edDOWNLOAD> > 12: } > 13: } > 14: else if ( Transfer->GetDstLevel() > Transfer->GetSrcLevel() ) > 15: { > 16: if ( Transfer->GetSrcDirection() == edDOWNLOAD )(Continue reading)
>>Question 2: This is really my most important question; Why do we not try
>>to change SrcDirection in line 22?
>>
>>
>>
>Because it doesn't make sense here. Both parties are trying to upload a
>file. but the other party has priority in this case, so they should
>switch direction or retry (if they're not wanting to download).
>
>
I'm reaching this code when I try to download files from certain DC++
users. I haven't explicitly tried to upload anything. Are files (like
filelists) automatically and secretly uploaded to the other party when I
try to download from them?
If the other party has priority, shouldn't we yield and switch
direction? Or do I misunderstand the nature of this priority?
>>Question 4: What does SrcDirection and DstDirection do anyway? It looks
>>to me like they need do be different, right? One side of the
>>communication should upload while the other downloads, is that it?
>>
>>
>>
>Yes, usually they'll be different. If everyone was active then theere
>wouldn't be a problem as you'd always be uploading to incoming
>connections and downloading from outgoing connections. With passive
>users you just don't know whether someone connecting to you is
RSS Feed