9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Nick Owens <mischief@9.offblast.org>
To: 9front@9front.org
Subject: ip/torrent and private trackers
Date: Fri, 31 Jan 2014 20:28:00 -0800	[thread overview]
Message-ID: <20140201042800.GA28628@iota.offblast.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]

ip/torrent in certain circumstances will never make progress.
specifically, sl reported that no progress was made while contacting the
tracker at bakabt.me. investigation revealed that the tracker was
actually returing an error message:

d14:failure reason95:use of this client is not allowed on our tracker,
please see http://www.bakabt.me/whitelist.phpe

see http://www.bakabt.me/whitelist.php for the whitelist.

in short, they don't like our peerid, -NF9001-. i have just made a
request on their forum to whitelist the id, but the alternative is to
spoof the peerid. the patch below allows you to specify the 8
character peerid with the -i argument when invoking ip/torrent.

setting my peerid to '-TR282Z-', which is transmission 2.82+, allowed me
to connect to bakabt's tracker.

additionally, i'll patch ip/torrent to report errors from the tracker,
so that this situation is less confusing to the user.

diff -r 20c2c6fccfee sys/src/cmd/ip/torrent.c
--- a/sys/src/cmd/ip/torrent.c	Sat Jan 11 16:07:35 2014 +0100
+++ b/sys/src/cmd/ip/torrent.c	Fri Jan 31 03:28:25 2014 -0800
@@ -1174,13 +1174,14 @@
 {
 	int sflag, pflag, vflag, cflag, fd, i, n;
 	Dict *alist, *wlist, *info, *torrent, *d, *l;
-	char *p, *s, *e;
+	char *p, *s, *e, *pid;
 	File **fp, *f;
 	vlong len;
 
 	fmtinstall('H', Hfmt);
 	alist = wlist = nil;
 	sflag = pflag = vflag = cflag = 0;
+	pid = nil;
 	ARGBEGIN {
 	case 'm':
 		mntweb = EARGF(usage());
@@ -1206,6 +1207,9 @@
 	case 'd':
 		debug++;
 		break;
+	case 'i':
+		pid = EARGF(usage());
+		break;
 	default:
 		usage();
 	} ARGEND;
@@ -1339,7 +1343,10 @@
 	case -1:
 		sysfatal("fork: %r");
 	case 0:
-		memmove(peerid, "-NF9001-", 8);
+		if(pid)
+			memmove(peerid, pid, 8);
+		else
+			memmove(peerid, "-NF9001-", 8);
 		for(i=8; i<sizeof(peerid); i++)
 			peerid[i] = nrand(10)+'0';
 		server();


[-- Attachment #2: Type: application/pgp-signature, Size: 834 bytes --]

             reply	other threads:[~2014-02-01  4:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-01  4:28 Nick Owens [this message]
2014-02-01  9:38 ` [9front] " cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140201042800.GA28628@iota.offblast.org \
    --to=mischief@9.offblast.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).