From dclark at pobox.com Sat Apr 4 02:03:44 2009 From: dclark at pobox.com (Daniel Clark) Date: Fri, 3 Apr 2009 20:03:44 -0400 Subject: Adding torrent to which I already have the file locally Message-ID: <968838230904031703k5b572d0eo5ea16f4f415e2205@mail.gmail.com> How to I use btpd to seed a torrent for which I already have the files locally? I tried putting the .torrent file in torrents (let's call it foo.torrent), the files in a directory under files (let's call the directory foo), and then: btcli add -d foo foo.torrent (from the torrents directory), but "btcli list" always shows "HAVE 0.0%". This is with 0.13 (doc in progress is up at http://config.fsf.org/trac/public/wiki/BitTorrent#btpd-theBitTorrentProtocolDaemon ). Thanks for any help, -- Daniel JB Clark | Sys Admin, Free Software Foundation pobox.com/~dclark | http://www.fsf.org/about/staff#danny From rnyberg at murmeldjur.se Sat Apr 4 11:58:59 2009 From: rnyberg at murmeldjur.se (Richard Nyberg) Date: Sat, 4 Apr 2009 11:58:59 +0200 (CEST) Subject: Adding torrent to which I already have the file locally In-Reply-To: <968838230904031703k5b572d0eo5ea16f4f415e2205@mail.gmail.com> References: <968838230904031703k5b572d0eo5ea16f4f415e2205@mail.gmail.com> Message-ID: <51101.85.24.201.222.1238839139.squirrel@webmail.stargirl.org> On Sat, April 4, 2009 02:03, Daniel Clark wrote: > How to I use btpd to seed a torrent for which I already have the files > locally? > > I tried putting the .torrent file in torrents (let's call it > foo.torrent), the files in a directory under files (let's call the > directory foo), and then: > > btcli add -d foo foo.torrent > > (from the torrents directory), but "btcli list" always shows "HAVE 0.0%". Path confusion? If you have '/path/torrents/foo.torrent' and '/path/files/foo' and your cwd is '/path/torrents', the command should read 'btcli add -d ../files/foo foo.torrent'. > This is with 0.13 (doc in progress is up at > http://config.fsf.org/trac/public/wiki/BitTorrent#btpd-theBitTorrentProtocolDaemon > ). > Will check it out. Regards, -Richard From rnyberg at murmeldjur.se Sat Apr 4 12:14:53 2009 From: rnyberg at murmeldjur.se (Richard Nyberg) Date: Sat, 4 Apr 2009 12:14:53 +0200 (CEST) Subject: Programming error for bad trackers? In-Reply-To: <200903092138.13325.nemosoft@smcc.demon.nl> References: <200903092138.13325.nemosoft@smcc.demon.nl> Message-ID: <51112.85.24.201.222.1238840093.squirrel@webmail.stargirl.org> On Mon, March 9, 2009 22:38, Nemosoft Unv. wrote: > Hello, > > I've noticed a small issue with btpd 0.15, and while investigating I may > have found a small coding error, although I'm not sure. > > First, my issue. I've noticed that if btpd gets some bad data from the > trackers for a torrent, it sometimes stops serving those torrents. I'm > not sure if this is a bug or a feature. If it is a feature, it's not > clear to me what criteria are applied to stop serving a torrent (like, > this many bad data in this many hours, etc.). The torrents are actually stopped? No, this is not a feature. I'll have to take a look at it. > So I looked at the code, and noticed this in btpd/tracker_req.c: > > break; > case TR_RES_BAD: > btpd_log(BTPD_L_ERROR, "bad data from tracker '%s' for '%s'.\n", > t->cur->url, torrent_name(t->tp)); > case TR_RES_OK: > if (TR_RES_OK) > btpd_log(BTPD_L_TR, "response from '%s' for '%s'.\n", > t->cur->url, torrent_name(t->tp)); > if (t->event == TR_EV_STOPPED) > > First, it seems there's a break missing in the TR_RES_BAD case; > it could be a deliberate fall-through, but > a) that is usually indicated with an > explicit /* fall-throught */ comment; It's deliberate, and it seems a little silly to comment code for correctness. > b), considering the next case is TR_RES_OK, it does not make sense to > treat failure and success in exactly the same way. (The > same applies to TR_RES_FAIL and TR_RES_CONN, BTW.) There are reasons they're treated the same, but I might need to tweak the logic a bit anyway. > Second, the first if-statement in TR_RES_OK is incomplete: > > if (TR_RES_OK) Oops! > This always evaluates to true. It's only a log message, but still... Regards, -Richard From rnyberg at murmeldjur.se Sat Apr 4 12:18:54 2009 From: rnyberg at murmeldjur.se (Richard Nyberg) Date: Sat, 4 Apr 2009 12:18:54 +0200 (CEST) Subject: Error in the name send to the client In-Reply-To: <6991B8C44A444405AB5DCBE4F124417A@usr.ingenico.loc> References: <6991B8C44A444405AB5DCBE4F124417A@usr.ingenico.loc> Message-ID: <51115.85.24.201.222.1238840334.squirrel@webmail.stargirl.org> Btpd doesn't use the ltep handshake, so there's no possibility of doing it wrong. ;) Other clients may or may not have code to recognize btpd's peer id signature, 'btpd/version|', or not. uTorrent doesn't seem to have it. Putting a signature in the peer id is a de facto standard, since the core protocol doesn't have any 'this is my name' message. Regards, -Richard From rnyberg at murmeldjur.se Sat Apr 4 12:21:27 2009 From: rnyberg at murmeldjur.se (Richard Nyberg) Date: Sat, 4 Apr 2009 12:21:27 +0200 (CEST) Subject: Stops downloading at some point In-Reply-To: References: Message-ID: <51117.85.24.201.222.1238840487.squirrel@webmail.stargirl.org> On Wed, March 11, 2009 21:51, Alexander Bogdanov wrote: > Okay, i'm testing it and here's the tracker, me, and the btpd (on > different machines) > I've created the torrent, started seeding and added it to the btpd so > it can download it, but it stopped downloading after some percents and > won't go further. > > I've stopped and then started it again, and downloading resumed okay. > But after some time it stopped again. > > Can't figure out, why is that so. > Could you try running with --logmask 127 and sending me the log? Regards, -Richard From syn at li.ru Sat Apr 4 12:35:06 2009 From: syn at li.ru (Alexander Bogdanov) Date: Sat, 4 Apr 2009 14:35:06 +0400 Subject: Stops downloading at some point In-Reply-To: <51117.85.24.201.222.1238840487.squirrel@webmail.stargirl.org> References: <51117.85.24.201.222.1238840487.squirrel@webmail.stargirl.org> Message-ID: I think it was all just my distro's package maintaiers. Their fault. I dunno how, but i downgraded to 0.13 (that was packaged by another maintainer) and everything went okay. 2009/4/4 Richard Nyberg > On Wed, March 11, 2009 21:51, Alexander Bogdanov wrote: > > Okay, i'm testing it and here's the tracker, me, and the btpd (on > > different machines) > > I've created the torrent, started seeding and added it to the btpd so > > it can download it, but it stopped downloading after some percents and > > won't go further. > > > > I've stopped and then started it again, and downloading resumed okay. > > But after some time it stopped again. > > > > Can't figure out, why is that so. > > > Could you try running with --logmask 127 and sending me the log? > > Regards, > -Richard > > > _______________________________________________ > btpd-users mailing list > btpd-users at murmeldjur.se > http://lists.stargirl.org/listinfo/btpd-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.stargirl.org/pipermail/btpd-users/attachments/20090404/3ed05dfe/attachment.htm From dclark at pobox.com Sat Apr 4 22:19:19 2009 From: dclark at pobox.com (Daniel Clark) Date: Sat, 04 Apr 2009 16:19:19 -0400 Subject: Adding torrent to which I already have the file locally In-Reply-To: <51101.85.24.201.222.1238839139.squirrel@webmail.stargirl.org> References: <968838230904031703k5b572d0eo5ea16f4f415e2205@mail.gmail.com> <51101.85.24.201.222.1238839139.squirrel@webmail.stargirl.org> Message-ID: <49D7C0C7.9070904@pobox.com> Richard Nyberg wrote: > On Sat, April 4, 2009 02:03, Daniel Clark wrote: >> How to I use btpd to seed a torrent for which I already have the files >> locally? >> >> I tried putting the .torrent file in torrents (let's call it >> foo.torrent), the files in a directory under files (let's call the >> directory foo), and then: >> >> btcli add -d foo foo.torrent >> >> (from the torrents directory), but "btcli list" always shows "HAVE 0.0%". > > Path confusion? If you have '/path/torrents/foo.torrent' and > '/path/files/foo' and your cwd is '/path/torrents', the command > should read 'btcli add -d ../files/foo foo.torrent'. That wasn't it, but I read in another thread that mktorrent was working better for some people, and that seems to have worked. These are the exact commands I used that worked (using mktorrent 0.5 and btpd 0.13): root at config:/srv/btpd/torrents# mktorrent -v -a \ http://config.fsf.org/rivettracker/announce.php \ ../files/FINAL-membercard-shipped-1 root at config:/var/lib/btpd/torrents# btcli add -d \ ../files/FINAL-membercard-shipped-1 \ FINAL-membercard-shipped-1.torrent Thanks, -- Daniel JB Clark | Sys Admin, Free Software Foundation pobox.com/~dclark | http://www.fsf.org/about/staff#danny -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature Url : http://lists.stargirl.org/pipermail/btpd-users/attachments/20090404/73f43e06/attachment.pgp From nemosoft at smcc.demon.nl Sun Apr 12 23:27:00 2009 From: nemosoft at smcc.demon.nl (Nemosoft Unv.) Date: Sun, 12 Apr 2009 23:27:00 +0200 Subject: Programming error for bad trackers? In-Reply-To: <51112.85.24.201.222.1238840093.squirrel@webmail.stargirl.org> References: <200903092138.13325.nemosoft@smcc.demon.nl> <51112.85.24.201.222.1238840093.squirrel@webmail.stargirl.org> Message-ID: <200904122327.00725.nemosoft@smcc.demon.nl> Hi, On Saturday 04 April 2009 12:14:53 Richard Nyberg wrote: > On Mon, March 9, 2009 22:38, Nemosoft Unv. wrote: > > Hello, > > > > I've noticed a small issue with btpd 0.15, and while investigating I may > > have found a small coding error, although I'm not sure. > > > > First, my issue. I've noticed that if btpd gets some bad data from the > > trackers for a torrent, it sometimes stops serving those torrents. I'm > > not sure if this is a bug or a feature. If it is a feature, it's not > > clear to me what criteria are applied to stop serving a torrent (like, > > this many bad data in this many hours, etc.). > > The torrents are actually stopped? No, this is not a feature. I'll have > to take a look at it. Yes, they stop. However, I can't seem to find a pattern to it. Sometimes I get a few bad tracker messages but the torrent continues, other times it stops after one message. It's my guess that the tracker is overloaded, and the HTTP request times out, or there is some other kind of error generated. Is there a way to enable logging of the data exchanged between btpd and the tracker? Or do I have to hack in some code for that? [code snipped] > > First, it seems there's a break missing in the TR_RES_BAD case; > > it could be a deliberate fall-through, but > > a) that is usually indicated with an > > explicit /* fall-throught */ comment; > > It's deliberate, and it seems a little silly to comment code for > correctness. Hmmm.... We obviously differ in our view on commenting code. That's fine, but you've managed to confuse at least one fellow programmer (me...) and it wouldn't surprise me if, after one or two years, you yourself look at this code and go "Huh? why did I do that?". So I don't consider it silly in this particular case... Anyway, if you need some more info on the tracker problem, I'd be happy to supply some logs, etc. Or maybe some tcpdump logs? - Nemosoft From abergeron at gmail.com Fri Apr 17 06:44:50 2009 From: abergeron at gmail.com (Arnaud Bergeron) Date: Fri, 17 Apr 2009 00:44:50 -0400 Subject: btpd solaris support Message-ID: I tried compiling btpd-0.15 on OpenSolaris 2008.11 since solaris support was annouced. I know I am a little late, but I had some long running problems of fighting with failing hard drives, anyway. The good news is that it compiles automagically (compared to the pain of before). But it crashes (with a segmentation fault) as soon as I add any torrent to it with this backtrace: #0 ul_on_new_peer (p=0x8083cf8) at btpd/upload.c:131 131 it = BTPDQ_NEXT(it, ul_entry); (gdb) bt #0 ul_on_new_peer (p=0x8083cf8) at btpd/upload.c:131 #1 0x0805f5c0 in peer_on_shake (p=0x8083cf8) at btpd/peer.c:435 #2 0x0805d396 in net_state (p=0x8083cf8, buf=0x803f7e0 "M6-1-2--n4\022?\003\215V\021\016???") at btpd/net.c:340 #3 0x0805d5e6 in net_read (p=0x8083cf8, rmax=0) at btpd/net.c:439 #4 0x0806692b in evloop () at evloop/poll.c:131 #5 0x0805c4df in main (argc=5, argv=0x807dbe0) at btpd/main.c:290 Exploring a bit I get this: (gdb) l 126 BTPDQ_INSERT_HEAD(&m_peerq, p, ul_entry); 127 else { 128 struct peer *it = BTPDQ_FIRST(&m_peerq); 129 where--; 130 while (where > 0) { 131 it = BTPDQ_NEXT(it, ul_entry); 132 where--; 133 } 134 BTPDQ_INSERT_AFTER(&m_peerq, it, p, ul_entry); 135 } (gdb) print it $1 = (struct peer *) 0x0 (gdb) print m_peerq $2 = {tqh_first = 0x0, tqh_last = 0x8079a04} I can provide you with access to the machine in question where I have this problem, if you need it. Arnaud From demenna at rdm-web.com Wed Apr 29 15:31:18 2009 From: demenna at rdm-web.com (Riccardo De Menna) Date: Wed, 29 Apr 2009 15:31:18 +0200 Subject: btpd not starting on osx server Message-ID: Hi Everybody, I'm trying to start btpd on OSX Server 10.5 but, unlike normal OSX, it fails to launch with a cryptic: > bind: Invalid argument Anyone has had the same problem or knows where should I look for? rdm From demenna at rdm-web.com Wed Apr 29 17:30:02 2009 From: demenna at rdm-web.com (Riccardo De Menna) Date: Wed, 29 Apr 2009 17:30:02 +0200 Subject: btpd not starting on osx server [SOLVED via workaround] In-Reply-To: References: Message-ID: Ok I'm replying to myself here since I found out what was wrong. Apparently it has nothing to do with the OS but rather the fact that, in the particular setup I was testing, the user home directory was not located on the main drive. Function ipc_init(void) in btpd/cli_if.c binds the socket to path /sock... I wonder... is there a reason why the OS returns an error on the "bind" operation if you try to open the socket on an external drive? Is it legit to do so? Maybe it has to do with the filesystem? The bind errno is EINVAL (22) and the description claims: Socket is already bound to an address and the protocol does not support binding to a new address. Alternatively, socket may have been shut down. Since the socket was just created it must be that the OS shuts down the socket right after trying to bind it. Bah... I'm no socket expert... maybe someone on the list can pick it up and figure out what's wrong. A little test on startup that informs the user that he needs to use a different btpd_dir (simply using the - d switch solves everything). Cheers, rdm From nemosoft at smcc.demon.nl Thu Apr 30 10:47:43 2009 From: nemosoft at smcc.demon.nl (Nemosoft Unv.) Date: Thu, 30 Apr 2009 10:47:43 +0200 Subject: btpd not starting on osx server [SOLVED via workaround] In-Reply-To: References: Message-ID: <200904301047.43343.nemosoft@smcc.demon.nl> Hello, On Wednesday 29 April 2009 17:30:02 Riccardo De Menna wrote: > Ok I'm replying to myself here since I found out what was wrong. Good! We like solutions :-) > I wonder... is there a reason why the OS returns an error on the > "bind" operation if you try to open the socket on an external drive? > Is it legit to do so? Maybe it has to do with the filesystem? Probably the latter; sockets are a Unix thing; if that external drive happens to be FAT32/NTFS drive, you can't create sockets there as far as I know (nor symlinks, fifo's, devices, etc.) Also creating/opening sockets on an NFS drive are probably illegal (at the very least, it won't do what you expect if you open it on 2 different machines). > The bind errno is EINVAL (22) and the description claims: > Socket is already bound to an address and the protocol does not > support binding to a new address. Alternatively, socket may have > been shut down. > > > Since the socket was just created it must be that the OS shuts down > the socket right after trying to bind it. EINVAL, or "Invalid" is a very general error code, used for just about any operation that cannot be completed. What happens within btpd is this: - The socket is created; this tells what type of transport mechanism we need, and reserves a slot in the process's file descriptor table. - using bind(), the descriptor is "bound" to a specific address; this address can be an IP address, or in this case, a Unix filename. - The OS detects it cannot create socket "files" on the desired path, and thus fails. So the OS didn't shut down the socket afer bind()ing, it never binded in the first place. - Nemosoft > btpd-users mailing list > btpd-users at murmeldjur.se > http://lists.stargirl.org/listinfo/btpd-users From demenna at rdm-web.com Thu Apr 30 12:47:50 2009 From: demenna at rdm-web.com (Riccardo De Menna) Date: Thu, 30 Apr 2009 12:47:50 +0200 Subject: btpd not starting on osx server [SOLVED via workaround] In-Reply-To: <200904301047.43343.nemosoft@smcc.demon.nl> References: <200904301047.43343.nemosoft@smcc.demon.nl> Message-ID: <5970BFF5-D3F6-438B-AF48-8B45B8D945C4@rdm-web.com> Hi Nemo, >> Ok I'm replying to myself here since I found out what was wrong. > > Good! We like solutions :-) :-) > EINVAL, or "Invalid" is a very general error code, used for just > about any > operation that cannot be completed. I know... I was quoting the specific case when bind(2) returns EINVAL. The drive was NFS yes, and the socket is apparently created (you can find the file on the drive and it's reported as a socket) but immediately shut down. Since it's working as intended it could useful to include an option (or an environnent var) to allow users to put the socket elsewhere without moving the whole btpd home dir. You might as well add a little note in the README just in case others stumble in this issue. BTW, off topic... I'd like to participate. Who are the devs working on btpd? rdm From axelgenus at gmail.com Thu Apr 30 12:59:28 2009 From: axelgenus at gmail.com (=?UTF-8?Q?Alessandro_Calor=C3=AC?=) Date: Thu, 30 Apr 2009 12:59:28 +0200 Subject: btpd not starting on osx server [SOLVED via workaround] In-Reply-To: <5970BFF5-D3F6-438B-AF48-8B45B8D945C4@rdm-web.com> References: <200904301047.43343.nemosoft@smcc.demon.nl> <5970BFF5-D3F6-438B-AF48-8B45B8D945C4@rdm-web.com> Message-ID: 2009/4/30 Riccardo De Menna : > > Since it's working as intended it could useful to include an option > (or an environnent var) to allow users to put the socket elsewhere > without moving the whole btpd home dir. You might as well add a little > note in the README just in case others stumble in this issue. > It would be very useful on linux too. > BTW, off topic... I'd like to participate. Who are the devs working on > btpd? Only Richard is working on BTPD. > > rdm > Bye, Alessandro.