Archive for the 'General' Category

Number your Result

Tuesday, July 11th, 2006

I assume you are by now a NMDC-search-hating person. All heil ADC’s search!

Yeah, I bit strong I know… But still. The NMDC-suckiness continues with the number of search results you recieve.

In NMDC, when sending a search, you will either get (from each user) 5 results if you are in Passive mode or 10 if you are in active mode. ADC have this restriction also. “Okay… Then what’s sucky if they’re the same?” Well, it’s a matter of which results you recieve.

In NMDC, there are no way to say “I want this, but not that”. In ADC on the other hand, there is; “Each filename (including the path to it) should be matched using case insensitive substring search as follows: match all AN, remove those that match any NO […] “. In laymans terms, “if I specify in the search that I want only file names (and paths) that have ’linux’ and doesn’t have ‘ubuntu’ in it (file name/path), I will only recieve results that have ‘linux’ in the file name/path and the sender of the results will have discarded all file names and paths matching ‘ubuntu’.”

So you dig through the archives, and find Filtering…, and think “hey! It says there I can filter out search results with -foo!”… Well, you’d be filtering the recieved results in NMDC. (Ehm, said ADC functionality, in DC++, doesn’t currently exist, mind you…)

If you don’t understand the problem; When you are sending a search in NMDC, the sender of the results does not do ANY filtering. He’ll send you the first 5 or 10 results said client can find. The client couldn’t care less if you don’t want ‘ubuntu’. But, in ADC, the sender of the results will know “hm, I can’t just blindly send results, this person has specifically said ‘ubuntu’ is not desired.”

Securing the version

Monday, July 10th, 2006

As DC++ 0.692, 0.693 and 0.694 has come out, DC++ has become more secure. Well, atleast in a use-ADC thing. If you look at the changelog, you’ll notice a myriad of ‘TLS‘ being mentioned. Well, this only work on ADC. So ha! you NMDC-something-something…

Anyway, the new versions… Well, there isn’t much in them (besides the TLS, which I haven’t tested by the way)… In any case, I’d skip DC++ 0.692 and 0.693 since they have some nasty bugs…

Answer to Pop quiz: Downloading in ADC

Sunday, July 2nd, 2006

I think this quiz was a little harder than the previous, but nontheless we have a winner, and it is (again) poy. Congrats. You win a free trip to the public DC dev hub. (Blatant plug :D )

One of the reason I believe this quiz was more difficult was because I didn’t include the actual answer in the options. (Well, d)…) Another reason is because it (sort of) require that you have been paying attention.

The question was: Why can’t Jake download the file list or any other file from “john111/2″? Because Jake already have a transfer going from “john111″. You see, “foobar” and “john111″ is the exact same person, using the same client, but with different user names. I’ll soon get to why they are the same user.

The reason I chose this scenario with university hubs, is because users tied to a university often share IPs. This means that one can’t look at the IP for comparison if two users are the same. (If people wouldn’t have shared IP, this would be a nice clue as to why Jake couldn’t download.)

So, why are “foobar” and “john111″ the same user? They have the exact same CID. I wrote in the previous post that DC++ look at the CID to check if two users are the same. ADC natively require CIDs, meaning that DC++ doesn’t “artificially” create the CID of other users. In terms, CIDs are global, (or atleast are supposed to be) meaning that your CID is the same in one, two or 40 ADC hubs.

Since DC++ see that they have the same CID, it thinks “hey, same user, don’t start another download because I’m already downloading from that user”.


There is an issue with the scheme DC++ currently use - Most users won’t understand what a CID is (CIDs are infact displayed in the user list) or why DC++ won’t start another download (”what the… it’s not the same user! crappy program!”). There have been discussion on how one could notify the user, among them; treeview of each download (”click on a ‘+’ to expand the list of usernames”); displaying “username1,username2,username3″ (I think this would be the easiest - codewise); Have DC++ print “You are already downloading from this user. The userlist/file has been queued”; a download mini slot option (like the upload mini slot option - but applying only to certain files, like the file list). Can anyone think of more?

Answer to Pop quiz: Downloading in NMDC hubs

Friday, June 30th, 2006

Time for the answer to the Pop quiz: Downloading in NMDC hubs.

First off, I want to congratulate poy for giving us the correct answers;
Q: How do you get the three files simultaniously from that user? (With DC++ 0.674)
A: Alternative b); use a different user name in all hubs.

Q: How do you get the three files simultaniously from that user? (With DC++ 0.691)
A: Alternative a); use the same user name in all hubs and b) use a different user name in all hubs.
Why alternative b) with DC++ 0.674? Well, it all has to do with how DC++ treat users. Users are identified by nick name alone (in 0.674), meaning that DC++ think “hey, you can’t start another transfer just yet from ‘foobar’, you are already downloading from him!”/”hey, you can’t start another transfer yet to _yournick_, you are already uploading to him!”. The “problem” is that there is no notification (eg, a reprahasing of what I just wrote).

Why is this different in DC++ 0.691 then? Why is option a) also correct? Because DC++ has changed its identification scheme. Now, DC++ identifies users with nick name and the hub address. This makes downloading files simultaniously incredibly easier with DC++ 0.691. You see, when DC++ check if it can connect to users, it looks at the CID of the user (CID is this identification, it basically is “encode with the Base32 mechanism[hash with Tiger[nick name + hub address]]”), and yet the nick name for is the same in the various hubs, the hub addresses surely aren’t. This is terms mean that DC++ think “not same user, allow transfer”, and we have ourselves a simultanious downloads.
This new scheme meant (as you’ve noticed) that all users in the queue and the favorite users were gone. The reason is above. The users had no CID, meaning DC++ thought “no CID, I have no idea who these people are, better get rid of them”. Now, there could have beeen some form of “conversion” for the favorite users, considering DC++ does store the hub name for the users, but it does not (as far as I know, I haven’t checked) for the queue. (I am not going to do a patch or any tool. Forget about it.)
What do you think? Was the old scheme better or is the new one? (Ignoring the upgrading problems.)
I’m hesitant to answer that question myself.

SETTING the settings

Saturday, June 24th, 2006

So you’ve gotten bored and you started looking in StringDefs.h. You notice that there’s a bunch of SETTING_SOME_OBSCURE_OPTION. When you search for it in other places in the source, you end up in resource.h and SomePage.cpp (and of course StringDefs.h) (where ‘SomePage’ is the name of one of the settings pages).

“How can these options then be used elsewhere if there’s no code to back it up? So DC++ completely ignores every single option there is?”
No, DC++ doesn’t. You see, all of the things in StringDefs.h that have SETTINGS_ before it are captions (text) in the settings pages. Meaning, they aren’t used as options. The names of the settings are instead SOME_OBSCURE_OPTION, and if you search for that, I assure you that you will see more places than above files. (And you can call the option with SETTING(SOME_OBSCURE_OPTION) or BOOLSETTING(SOME_OBSCURE_OPTION).)

Pop quiz: Downloading in ADC

Saturday, June 24th, 2006

The second pop quiz is as follows;
‘Jake’ using an unmodified version of DC++ 0.691. He’s connected to 2 (two) ADC hubs with the nicks “jake99″ and “mary77″. He’s looking for the file A. He find user “foobar” in one of the hubs who have the files he’s looking for. This user is also using an unmodified version of DC++ 0.691. He start to download the file, going in 20 KiB/s and everything’s fine. But, he start to think, “what will happen if the user goes offline? better I auto search for it to check if there’s more sources”. And he does, and find user “john111″. Jake adds the user to list of sources (through the right click command menu).

Interesting in things as Jake is, he want to see what other goodies “john111″ has in his share. Jake tries to get the file list. Nothing. Nothing happens. He checks the queue, DC++ has properly queued the file list, but isn’t connecting. Nothing appear in the transfer view. The transfer view columns are fine, Jake can see that he has two downloads going (one of them the file A) and three uploads.

 But there’s no error message in the queue or the transfer view window. He deletes the file list from the queue, and tries again to download it. Same thing. Now, why can’t Jake download the file list? “john111″ isn’t blocking uploads by the looks of it in the search window (Jake can see that “john111″ has 5 slots open out of 7). Jake and “john111″ is both connected with Active mode.

The two hubs are both resident on the same university campus, where a lot of people connect from. Meaning, a lot of people have the same external IP. (Jake find out that “john111″ has the same IP as “foobar” and one of Jake’s uploads, and he draws the conclusion that those three are all living on the same campus.)

Jake asks his friend in the other room to try to download “john111″’s file list (and other files), and it works fine. It also works for other users in the same hub. Jake asks “john111″ to change his nickname to “john112″. No change in connectivity. “john112″ tell Jake to try and search for file B and try to download it. Same thing happens with file B. File B is now queued, but there’s no connectivity and no error message.

So; why can’t Jake download the file list or any other file? (File A has been downloading the entire time, now at 34 %.)

a) Jake is using different user names.
b) there’s a bug in Jake’s copy of DC++.
c) “john112″ and everyone else is lying, at Jake’s expense.
d) none of the above… (fill in what the reason is)

It would be neat if you have an explanation why you chose that particular option, but you don’t have to; I’ll explain later which option/answer is correct, and why.

Pop quiz: Downloading in NMDC hubs

Saturday, June 24th, 2006

To increase the interaction between the blog and our blog readers, I thought we could have a “pop quiz”. I’ll also be so kind to have multiple choices for you to pick from.

Today’s pop quiz;
You are using an unmodified version of DC++ 0.674. You are connected to 3 (three) NMDC hubs with no relation. (They aren’t connected through a “network” that is.) You are looking for the files A, B and C. You find user “foobar” in the three hubs (the same user accross hubs) who have all the files you’re looking for. This user is also using an unmodified version of DC++ 0.674. Now, the question is; How do you get the three files simultaniously from that user? Speed is not a matter, neither is active vs passive mode and there’s no hub restrictions or slot restrictions from “foobar”.
Do you
a) use the same user name in all hubs
b) use a different user name in all hubs
c) call two friends and asks them to download file B respectively file C while you download file A. You then walk over to their homes and burn the files on a CD.
d) completely ignores the question I asked and download the files in a row (that is, not simultaniously).
e) say I’m stupid because “foobar”’s copy of DC++ will use the IP to not allow you to download them simultaniously.
f) none of the above, you… (fill in what you do)

Now, the same question, but with the difference that you and “foobar” are both using DC++ 0.691.
It would be neat if you have an explanation why you chose that particular option, but you don’t have to; I’ll explain later which option/answer is correct, and why.

Me, myself and Unsigned

Monday, June 12th, 2006

One of the problems when creating software is to predict and know what kind of input people will give when they fiddle around in the settings of the program. DC++ no less also has this issue. Though, while it’s easy to picture (as a programmer) what the user input will be, the code outcome might not always be what the programmer originally intended.

The issue I’m going to talk about today is an issue that arose with people upgrading from DC++ 0.674 to 0.691. (I don’t know if the problem was or not possible with 0.674.)

A bug report and patch was swiftly created and will most likely be introduced in “0.692″ (upcoming version).

If you look at the patch, you will see that lines starting with ‘-’ is removed and ‘+’ is added. With this knowledge, the only “real” change you will see in the patch is that instead of “short” it says “unsigned short”. What this change really does lies in the way C++ (DC++ is written in C++) is designed.
(If you have programming knowledge, you know a short is a type for variables/functions etc. For the no-programming-knowledge-people; Consider that you have a box. This box can store a value, but only one, at any given time. Now, this box have to have a ‘type’, meaning it can only contain values of that certain type. short is one of those types.)

In C++, if a type has nothing before it, it is ’signed’; This means that it can contain values up to 2^15. The problem is that socket ports can reach 2^16. And this is where the ‘unsigned’ comes in the picture. If a type has ‘unsigned’ before, it not only support 2^15, but also 2^16. We come to the conclusion that using ‘unsigned’ before removes our issue.

Another thing you might notice with the current behaviour, it is that if you input a value above 2^15 (but below 2^16), you will then use - 2^16, this of course leading to a negative value. An interesting thing is that if you input something above 2^16, the value used will then also be - 2^16.

Port forwarding on OpenBSD

Monday, May 29th, 2006

I’ve never used OpenBSD, but I’ve heard that the BSD-flavours are great for routing (using a physical box).

Since the support subforum is purged after two weeks, I thought a nice “guide” to do port forwarding on a OpenBSD box was in place.

Disclaimer: I have no tried this but considering ‘Slycer’ did it (and assuming he/she didn’t leave anything out), I have no reason to doubt.

(The code is a copy-paste from Slycer’s configure file.)

# cat /etc/pf.conf
# $OpenBSD: pf.conf,v 1.31 2006/01/30 12:20:31 camield Exp $
# See pf.conf(5) and /usr/share/pf for syntax and examples.
# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1
# in /etc/sysctl.conf if packets are to be forwarded between interfaces.

# — MACRO section
# — Change ext_ip to your external IP ( eg)
ext_if = rl0
int_if = rl1
ext_ip = “″

# — Write here the internal IP the box you want to forward the port to
Dc = “″

# — Write here which ports you wish to forward
DcUDP = “1111″
DcTCP = “2222″

# — OPTIONS section
set skip on lo0
set skip on $int_if

nat pass on $ext_if inet from any -> $ext_if

rdr pass on $ext_if proto { tcp, udp } from any to any port { $DcTCP, $DcUDP } -> { $Dc }

# — FILTER section

# — default policy
block log all

pass out quick on $ext_if inet all keep state

You should then input your external IP in DC++ and then input the DcUDP/DcTCP ports in DC++.

Money and DC++

Wednesday, May 24th, 2006

While going through the forum, looking for interesting things to blog about, I noticed a thread by Ali;

If you had to pay for DC++, how much would you be willing to pay? A slightly
different angle: How much do you think it is *worth*?

The thread was started 2003-06-23, and I probably wouldn’t have paid for it back then. But now… If I were forced, I probably would.

A question that arose from the thread was; Who should get the money? A lot of people have been a part of the DC++ project; patching, supporting and general assistance. Is it “fair” that Sieka recieves money for things that a lot of other people have helped put together? Is it “fair” because he did the initial framework and everyone else “just got on the wagon”? I’m not sure if I would feel comfortable if I were to recieve money all of a sudden. Don’t get me wrong, I like money, but getting money for something that I enjoy doing… Wouldn’t that make me a whore? I know Pederzani has said he wouldn’t accept money “to do features” and I don’t think I would either.

What do you think? Is DC++ worth any money by today’s standards? If so - Who do you think should get them?