Page 1 of 1

How to fix G2 to connect automatically (PATCH)

PostPosted: 25 Sep 2014 12:57
by Lanigiro

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 26 Sep 2014 14:57
by raspopov
Thank you. BTW you must use proper forum.

Also this is very em... "wrong" idea, for example Shareaza can be used in China so at that point of view we must block everything except China. :D

Other way: you can enumerate all China IP addresses and create security filters for it.

Or find a bad web-caches polluted with china clients (and exclude it).

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 28 Sep 2014 23:46
by brov

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 25 Oct 2014 18:21
by Lanigiro
Any solution involving adding security rules to Shareaza (manually or automatically) will cause Shareaza to get slow and wonky, in my experience, as it tends to if there are a bazillion security rules rather than a couple of dozen or so.

Any solution involving banning from outside Shareaza (operating system level or router -- IPtables, firewall rules, PeerBlock, software firewall, etc.) will interfere with non-Shareaza applications, e.g. web browsing, and thus have unwanted side effects.

I don't see a problem with my original suggestion. Even if some people use Shareaza from inside China, they're a minority and furthermore Shareaza could use the net-facing IP of itself to decide whether to exclude the three country codes noted from the G2 cache or exclude everything else. Or if it's asymmetrical, exclude nothing when operated inside China. Or always exclude China from G2 hub list (which is what the code will do if used unmodified). Whatever seems to work best for both sides of the GFW.

If the other suggestion on QA packets would work, maybe modify it to just silently not add to the hostcache, without gumming up Shareaza with (eventually) thousands of security rules that will bog things down. As long as the problem hubs never make it into the G2 hostcache the problem is solved.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 25 Oct 2014 23:49
by brov
Another part of problem are KHL packets. Shareaza happily sends KHL/CH (cached hub) with foxy's vendor code and address, causing the pollution. As Shareaza already knows banned vendor code, why not filter out them at receiver side (maybe ban is too hard, just filter them out)? IP range and/or country checks are not required. Just 'trust' KHL packets to some extent. And why it accepts banned vendors in first place?

As for QA packets. I am using that heuristics in Quazaa project and it performs very well (never got any false positive yet, althrough needs more testing).

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 24 Dec 2014 02:11
by ivan386

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 28 Dec 2014 17:50
by raspopov
I think "IgnoreCountry" option should be spelled as "IgnoredCountry" and has a string_set type. Can you make a patch with changes?

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 03 Jan 2015 00:46
by ivan386

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 03 Jan 2015 08:32
by raspopov

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 04 Jan 2015 11:45
by ivan386
Fixed

Maybe it was a try to catch zero pointer.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 04 Jan 2015 19:43
by queuesclimber
Grmm, it still tries connecting to East Asian Hubs in Network.
But maybe I did understand something wrong, what this patch is for. :)
Or I missed update some settings.
If I get a Shareza in EA, ok.
But please, not a Hub.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 04 Jan 2015 21:02
by ivan386
This patch prevents add of TW HK CN hubs in HostCache. It not removes already added. Need to clear cache.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 05 Jan 2015 14:51
by queuesclimber
+1
Great patch.
They are gone. Many, many thanks.

Re: G2 Connect Foxy Flood

PostPosted: 05 Jan 2015 16:50
by skinvista
While this patch could be useful to ban a specific country in niche situations,
as-is it still potentially "disallows use" of Shareaza in large regions where you are simply trying to block Foxy.
Indicated by "FOXY" "RAZB" or none, apparently.

See my long-standing solution:
https://sourceforge.net/p/peerproject/code/HEAD/tree/trunk/PeerProject/Security.cpp#l721

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 11 Jan 2015 02:18
by brov
This is not a good solution too. You simply sticked to block Asian countries, so no Asians can use raza. Better to fix KHL/CH handling and temporarily block suspicious hubs (simple heuristics will do the job).

Re: G2 Connect Foxy Flood

PostPosted: 11 Jan 2015 19:38
by skinvista
The intention is to block "FOXY" - the country codes are only necessary to catch specific "RAZB" and blanks that are still factors.
And yes, I noticed that I should check for these codes before country as an optimization.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 27 Jan 2015 17:47
by ivan386
My path do not ban leafs from that country. It only not add it to host cache. My hub now have 2 leafs from CN.

Check host before share

PostPosted: 30 Jan 2015 23:54
by ivan386

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 22 Feb 2015 16:49
by queuesclimber

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 25 Mar 2015 20:07
by queuesclimber

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 17 Jan 2016 14:59
by ale5000
Why instead of banning TW HK CN host from hostcache they aren't just limited to something like 5% of the hostcache and un-preferred in the connection process?

This should avoid pollution but still keep potentially valid hosts.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 17 Jan 2016 17:47
by ivan386
Shareaza need to check hosts before share it with others. This eliminates the need to exclude the country from the cache.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 17 Jan 2016 20:06
by raspopov
I don't think Shareaza must share tested hosts only.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 17 Jan 2016 21:22
by ivan386

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 19 Jan 2016 20:44
by raspopov
It's right for BitTorrent DHT only.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 20 Jan 2016 04:07
by ale5000
What about share hosts from TW HK CN only if tested and all others also if untested?
I think it is a good compromise.

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 22 Jan 2016 23:48
by Haluser5
I installed the current version a few days ago and G2 took 15 minutes to connect because it kept scrolling through TW CN HK hosts. The average user will not wait this long for something to work right. They will say screw it! JMO

Re: How to fix G2 to connect automatically (PATCH)

PostPosted: 24 Jan 2016 04:51
by ale5000
Use the updated DefaultServices.dat here: https://sourceforge.net/p/shareaza/code ... format=raw
It should help a bit because it block empty GWCs and add many working GWCs.