-dealing with errors: -> replace most return -1 with sysfatal as long as it doesn't terminate the whole program but just a thread that can be restarted -why is the break in xfer (comm.c) needed when reading from a tracker reply? -forgerequest(): -better overall algo (stupid dance with announce) -size of buf to allocate -better propername(), dealing with other stupid chars -tracker struct to store values like "interval" ? -do a getbestr equivalent to use in comm.c:getelement -verif hton() when send request is valid for big endian arch -smarter handling of keepalives -'datadir' and 'datadir dir' to ctl -how long do we keep open the files which have already received some pieces? -> for the moment, never let open. open when needed to write, close immediately after. probably very lame and slow, but simplest. -rethink and maybe split the Torrent struct (separate everything related to the datafiles?), it's getting bloated. -check algo ok (preppieceslist) if data is an exact number of pieces -cat pieces -> print bitfield -make use of complete and incomplete from tracker reply -why does rtorrent see <16384> (invalid piece) when asking for a piece it does not have? -> hence the connection closed -make a func for update list (element removal) -improve clean up in the case when we just kill the current thread -create a pool of a few threads in advance, use them as needed, and keep the pool full by creating new threads everytime they're consumed. -check why it happens that threads ask for the same pieces. -algo in writedata() could be more compact... -fix last piece case in checkpiece() -find out why demonoid and tpb kick me out. changing webfs ua and the peerid does not help. -comm.c:hello():chanfree(cio) ? -seeding: 1) scan what we already have and check hashes 2) create bitfield (and pieceslist) 3) send bitfield during hello() 3) create a coroutine that listens 4) seed 5) update our bitfield (and pieceslist) when appropriate send not interested? -case when torrent.c:checkpiece returns not good -shared pieces in torrent.c:scanpieces -size of bitfield is not +1 when it's a multiple of 8. -check nothing broken since writemsg(uchar) -> writemsg(char) -broken with rtorrent now :/ -when expecting the bitfield, should be prepared for something else -writes -> writen(?), same for reads