Thursday Jan 22nd - Saturday 24th: Maybe holiday. If it isn't:
Thursday
- Analysis of code produced to achieve these goals, in mind to get feedback and to ease maintenance: Logical order; Structure; Commenting (just want to remove anything too embarrassing, there's been too many late nights recently).
- Release code to here.
Friday
- Add functions relying on timed event, specifically:- updating the tracker; keep-alive with peer.
- Buffer on write fails: a write fail should result in a new rewrite attempt in the event queue.
- Update peers with HAVE messages on successful download of a piece. (Fire an event, let the event handler deal with the distribution of HAVE to peers)
- Start responding to INTERESTED. Fire an event, the handler should check how many are currently unchoked, and if a threshold is not reached, unchoke. Maintain list of INTERESTED & unchoked, and INTERESTED & choked.
- If a REQUEST msg is fired on an unchoked peer, write the request back. After writing it back, examine history. If this is a peer we are actively exchanging with, keep unchoked. If this is a peer we are not actively exchanging with, increment _sent. If _sent is greater than threshold, write choke back, remove from INTERESTED & unchoked, add to end of INTERESTED & choked. Fire event that will allow INTERESTED & choked to be re-examined, and a new peer to become unchoked. Fire this event on peer disconnected too, after cleanup (ie. after peer is removed from INTERESTED & unchoked or INTERESTED & choked, if they're in either)
- If a NOT INTERESTED msg is fired on an unchoked peer, remove from any INTERESTED list it is part of, and then choke.
- Open the Mozilla server socket.
- Accept connections. Add timeout to drop connections that have timedout.
- Listen for handshakes. On Handshake, send Handshake. Send BITFIELD. Then act as normal.
- Set up tracker on test server.
- Resolve x-htp2p URLs to multiple .torrents. Treat file in torrent as the data from that URL.
- Resolve x-htp2p URLs to single .torrent, then try to resolve URL to file in that torrent. Treat that file as the data from that URL.
- Make limit on PieceManager so that only pieces related to target URLs are downloaded.
- Make PieceManager talk to return channel, so that as Pieces are verified, they are written out.
- Do what wasn't achieved Friday. If it all was, have a beer. Maybe even have a TSD. Congratulations, you're ready for the next supervision meeting.
No comments:
Post a Comment