How to fix G2 to connect automatically (PATCH)

After you have edited the source code, post your patch here.
Forum rules
Home | Wiki | Rules

How to fix G2 to connect automatically (PATCH)

Postby Lanigiro » 25 Sep 2014 12:57

Lanigiro
 
Posts: 202
Joined: 10 Feb 2014 14:19

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

Postby raspopov » 26 Sep 2014 14:57

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).
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

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

Postby brov » 28 Sep 2014 23:46

brov
 
Posts: 87
Joined: 05 Jul 2009 12:15

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

Postby Lanigiro » 25 Oct 2014 18:21

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.
Lanigiro
 
Posts: 202
Joined: 10 Feb 2014 14:19

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

Postby brov » 25 Oct 2014 23:49

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).
brov
 
Posts: 87
Joined: 05 Jul 2009 12:15

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

Postby ivan386 » 24 Dec 2014 02:11

ivan386
 
Posts: 261
Joined: 17 Jun 2009 14:08

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

Postby raspopov » 28 Dec 2014 17:50

I think "IgnoreCountry" option should be spelled as "IgnoredCountry" and has a string_set type. Can you make a patch with changes?
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

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

Postby ivan386 » 03 Jan 2015 00:46

Attachments
IgnoredCountry.zip
(48.19 KiB) Downloaded 866 times
Last edited by ivan386 on 04 Jan 2015 11:43, edited 1 time in total.
ivan386
 
Posts: 261
Joined: 17 Jun 2009 14:08

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

Postby raspopov » 03 Jan 2015 08:32

User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

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

Postby ivan386 » 04 Jan 2015 11:45

Fixed

Maybe it was a try to catch zero pointer.
ivan386
 
Posts: 261
Joined: 17 Jun 2009 14:08

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

Postby queuesclimber » 04 Jan 2015 19:43

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.
queuesclimber
 
Posts: 299
Joined: 29 Oct 2013 16:24

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

Postby ivan386 » 04 Jan 2015 21:02

This patch prevents add of TW HK CN hubs in HostCache. It not removes already added. Need to clear cache.
ivan386
 
Posts: 261
Joined: 17 Jun 2009 14:08

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

Postby queuesclimber » 05 Jan 2015 14:51

+1
Great patch.
They are gone. Many, many thanks.
queuesclimber
 
Posts: 299
Joined: 29 Oct 2013 16:24

Re: G2 Connect Foxy Flood

Postby skinvista » 05 Jan 2015 16:50

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
User avatar
skinvista
 
Posts: 74
Joined: 13 Jun 2009 16:34
Location: Boston/NewYorkCity

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

Postby brov » 11 Jan 2015 02:18

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).
brov
 
Posts: 87
Joined: 05 Jul 2009 12:15

Re: G2 Connect Foxy Flood

Postby skinvista » 11 Jan 2015 19:38

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.
User avatar
skinvista
 
Posts: 74
Joined: 13 Jun 2009 16:34
Location: Boston/NewYorkCity

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

Postby ivan386 » 27 Jan 2015 17:47

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.
ivan386
 
Posts: 261
Joined: 17 Jun 2009 14:08

Check host before share

Postby ivan386 » 30 Jan 2015 23:54

Attachments
HostCache.zip
(8.62 KiB) Downloaded 848 times
ivan386
 
Posts: 261
Joined: 17 Jun 2009 14:08

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

Postby queuesclimber » 22 Feb 2015 16:49

queuesclimber
 
Posts: 299
Joined: 29 Oct 2013 16:24

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

Postby queuesclimber » 25 Mar 2015 20:07

queuesclimber
 
Posts: 299
Joined: 29 Oct 2013 16:24

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

Postby ale5000 » 17 Jan 2016 14:59

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.
ale5000
 
Posts: 66
Joined: 18 Nov 2012 22:56

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

Postby ivan386 » 17 Jan 2016 17:47

Shareaza need to check hosts before share it with others. This eliminates the need to exclude the country from the cache.
ivan386
 
Posts: 261
Joined: 17 Jun 2009 14:08

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

Postby raspopov » 17 Jan 2016 20:06

I don't think Shareaza must share tested hosts only.
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

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

Postby ivan386 » 17 Jan 2016 21:22

ivan386
 
Posts: 261
Joined: 17 Jun 2009 14:08

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

Postby raspopov » 19 Jan 2016 20:44

It's right for BitTorrent DHT only.
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

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

Postby ale5000 » 20 Jan 2016 04:07

What about share hosts from TW HK CN only if tested and all others also if untested?
I think it is a good compromise.
ale5000
 
Posts: 66
Joined: 18 Nov 2012 22:56

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

Postby Haluser5 » 22 Jan 2016 23:48

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
Haluser5
 
Posts: 8
Joined: 07 Apr 2014 13:54

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

Postby ale5000 » 24 Jan 2016 04:51

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.
ale5000
 
Posts: 66
Joined: 18 Nov 2012 22:56


Return to Code Submission

Who is online

Users browsing this forum: No registered users and 1 guest