{"shas":[["53b19b5f02ad9585114cbcb15269c09aa6f412e4","f29ad1c43d6e24ab863bcf5eb886cdeef200167f@gmail.com","bittorrent/stream.py: prefer exceptions to LOG.error()+close()\n\nWhen there is a protocol error, raise an exception instead of\nlogging the error and then invoking close.  The gain is that when\nwe raise an exception the connection is automatically closed by\nthe net/poller.py code and we don't need to worry about doing\na clean shutdown.","Simone Basso"],["5ee13149381441f7fdec54f609ae463638cfd4a2","f29ad1c43d6e24ab863bcf5eb886cdeef200167f@gmail.com","bittorrent: Add and use new BitTorrent peer model\n\nThis patch adds a new BitTorrent peer model and propagates changes\nso that bittorrent now uses the new model.\n\nNote that the new peer model incorporates the functionalities of\nthe old Upload, Download, and \"parent\" classes into the same class,\nbasically because that makes me feel more comfortable with the\nsource code.\n\nAnother relevant change is that the peer model can manage more than\none stream at the same time, so the interface between the stream and\nthe peer now requires the stream to pass also a reference to self,\nfor the peer to know what stream received what message.\n\nWhile there, I have also removed some unused variables from the\nstream, and I have renamed the stream in a way that is more consistent\nwith other streams in Neubot.","Simone Basso"],["fac802ab6ab2d89729733582565ebb14bf804c7e","f29ad1c43d6e24ab863bcf5eb886cdeef200167f@gmail.com","bittorrent: cache partial PIECE params in stream.py\n\nWhen we're reading a jumbo PIECE message and we read more than\nthe maximum message size, we pass upstream the chunks as we read\nthem from the socket.\n\nFine.  But the peer is designed to manage more than one stream\nat a time, and we just pass it the chunks without the parameters.\nSo, we would likely need in the future to cache the PIECE params\nfor each stream in the peer.\n\nUgly.  A better solution instead is to cache inside the stream\nthe current jumbo PIECE parameters and then pass each time such\nparameters to the peer.\n\nThis is what this patch implements.","Simone Basso"],["efe65661b53408808adc8dde69dc45730467f5d5","f29ad1c43d6e24ab863bcf5eb886cdeef200167f@gmail.com","bittorrent: ConnectingPeer + ListeningPeer = PeerSimple\n\nThis patch merges bittorrent/main.py ConnectingPeer and ListeningPeer\ninto PeerSimple.  This class receives and sends as much small BitTorrent\nmessages as possible, so we test at the same time both the upstream and\nthe downstream path.\n\nWhile there, also sort the imports.","Simone Basso"],["74402608cb6469763bba8e980028cc18729d5557","f29ad1c43d6e24ab863bcf5eb886cdeef200167f@gmail.com","bittorrent/stream.py: bitfield is optional\n\nBitfield is optional so it make sense to automatically try to send\nit at the stream level, if possible.\n\nIf the bitfield is not present probably the peer object is going to\ncreate one when it starts receiving pieces.","Simone Basso"],["3b1629105a051c61c77e9de3b83feb0280eda50f","f29ad1c43d6e24ab863bcf5eb886cdeef200167f@gmail.com","Merge branch 'add-bittorrent-peer' into next","Simone Basso"]],"ref":"refs/heads/next","size":6,"head":"3b1629105a051c61c77e9de3b83feb0280eda50f","push_id":32940639}