Im trying to make a patch to ignore peers that send bad data.
I modified the function dl_on_bad_piece(tp->net, piece, p)
to pass struct peer.
Now I have problem w/ peers itself. Where to hook to ignore
peer and do not send piece request for it?
I belive disconecting such peer is not a good idea,
you lose struct peer data, its just good to keep him connected
and stale.
Any suggestions?
Regards,
Borg
Well, if they keep sending bad data, disconnecting might be the best option. I
would suggest a simple counter. Initially, the counter is 0; everytime a peer
sends a bad packet increase the counter; when you receive a good packet,
decrease it, but don't go lower than 0. If the bad packet counter hits a
threshold (say, 5), disconnect them. This way the occasional bad packet won't
hurt the peer, but if they keep messing up it's bye-bye.
- Nemosoft
peer will only send data when we request it, right?
so I rather think about some extra flag to not request
any more data from the peer and keep connection open
because it my be worth to send pieces to that peer anyway.
so I want to keep ignoring data that cames from bad peer,
send info to him that we dont want more.. and eventualy send
him our pieces (when peer is not a seed of course).
the disconnect aproach is the last thing I want to do...
---------- Original message ----------
Unfortunetly I didnt had time yet to check it out.
If anyone with high knowledge can peek at my git repo
and put some comments..
git://borg.uu3.net/btpd.git
branch: badpeers
Unfortunetly I work w/ btpd-0.13 becase I found it very stable.
Regards,
Borg
---------- Original message ----------