Dash and space war!

If you are using DC++ 0.694, you will notice that in most NMDC hubs, the name of the hub and “topic” have two dashes (” – – “) instead of just one (” – “), as it was previously.

However, in ADC hubs, everything will appear fine (with just one dash). This is because in ADC, the hubname and description (aka topic) is sent by two flags, NI and DE. What DC++ does is; hubname + ” – ” + description. So if the hub send NIhello DEblah, this is what will appear; hello – blah (someipblabla.com).

But, in NMDC, the hubname and description (topic) sent as one command. $Hubname. (There is $Hubtopic but few support it.) So, in NMDC; $Hubname hello – blah. You see here that there’s no actual way for DC++ to really know what is the hubname and what is the description. Because everything is essentially the hubname. The fact that a “description” is present in today’s hubs is something of a ‘hack’, and not likely anticipated by Jonathan Hess (the author of NMDC).
“Then why is there two dashes now?” Well, what I said earlier about DC++ adding ” – ” between hubname and description apply here too. But here, DC++ have to hack in what is the hubname and what is the description. DC++ does this with the current scheme;
search for breaking-space (‘ ‘); set the hubname to everything before the breaking-space, and the description to everything after the breaking-space.
(I’m sure you can imagine if people send $Hubname h e l l o – there| and use breaking-space after the ‘h’, it will appear in DC++; “h – e l l o – there”.)
So, if you want your hubname to be “h e l l o” and description “there”, the spaces in “h e l l o” must be non-breaking spaces. This will of course break backwards compatibility (for all other clients). There’s a proposed solution. To not search for ‘ ‘, but instead search for ” – “, and assign everything before ” – ” to the hubname and everything after to the description.

(Bugreport #1033 brought forward this issue.)

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: