hublist url redirection

Archived discussion about features (predating the use of Bugzilla as a bug and feature tracker)

Moderator: Moderators

Locked
TheNOP
Posts: 275
Joined: 2003-07-07 21:41
Location: Quebec

hublist url redirection

Post by TheNOP » 2003-11-06 20:46

hublist are getting bigger and bigger each years and more users use those lists.
to solve some bandwidth (hits) problems, i tough of distributing the loads to other puters.
but this is impossible with the way DC++ fletch the hublist currently.
what is needed, is to be able to get DC++ follow url redirection when DC is told to do so.

or meabe there is an other way around?
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

Xan1977
Forum Moderator
Posts: 627
Joined: 2003-06-05 20:15

Post by Xan1977 » 2003-11-06 21:46

Code: Select all

[21:34] *** Connecting to hublist.no-ip.org...
[21:34] *** Connected
[21:34] <HubList> This Public Hublist is running version 0.1.2 alpha of HublistServer (RunTime:4days 7h 18min).
[21:34] <HubList> Sorry, the Public List is full, try again later...
[21:34] *** Disconnected
[21:34] *** Connecting to www.1stleg.com...
[21:34] *** Connected
[21:34] <HubList> Sorry, hublist full...
[21:34] *** Disconnected
:D





With the current system, users have to manually add several hublist addresses, so if the first one fails, then it will try the next after the user hits Refresh. Redirects would avoid all the manual copy/pasting and clicking. I think I like your idea. :) But I'm gonna hazard a guess that it would take some serious changes to the way hublists are retreived in order to implement it.

TheNOP
Posts: 275
Joined: 2003-07-07 21:41
Location: Quebec

Post by TheNOP » 2003-11-06 22:15

thanks
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-11-06 22:16

-- 0.241 2003-04-01 --
* Added support for "302 file moved" for hublist downloads (thanks sedulus/sandos)
it even worked that well that when people were requesting a bz2 list from neomodus (that does not exist) they were getting a hublist, be it a load of garbage though (the 404 contents which included a pipe here and there)
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

TheNOP
Posts: 275
Joined: 2003-07-07 21:41
Location: Quebec

Post by TheNOP » 2003-11-06 22:41

what is the format of the reply accepted by DC?
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-11-06 22:45

Code: Select all

		if(aLine.find("200") == string::npos) {
			if(aLine.find("302") != string::npos){
				moved302 = true;
			} else {

Code: Select all

	} else if(moved302 && aLine.find("Location") != string::npos){
		dcassert(socket);
		socket->removeListener(this);
		socket->disconnect();
		BufferedSocket::putSocket(socket);
		socket = NULL;

		string location302 = aLine.substr(10, aLine.length() - 11);
		// make sure we can also handle redirects with relative paths
		if(Util::strnicmp(location302.c_str(), "http://", 7) != 0) {
			if(location302[0] == '/') {
				Util::decodeUrl(currentUrl, server, port, file);
				string tmp = "http://" + server;
				if(port != 80)
					tmp += ':' + Util::toString(port);
				location302 = tmp + location302;
			} else {
				string::size_type i = currentUrl.rfind('/');
				dcassert(i != string::npos);
				location302 = currentUrl.substr(0, i + 1) + location302;
			}
		}
		fire(HttpConnectionListener::REDIRECTED, this, location302);

		downloadFile(location302);
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

TheNOP
Posts: 275
Joined: 2003-07-07 21:41
Location: Quebec

Post by TheNOP » 2003-11-07 05:46

thanks

now let me see where did i put that book, learn c++ in a few hours... :lol:
TheNOP

Have you read the FAQ?
Or the sticky ? It might give you idea.

Locked