Commit graph

434 commits

Author SHA1 Message Date
Yuxin Wang
d638604510 Add check if the file whose chunk is being registered exists. 2018-10-09 01:09:41 -04:00
Yuxin Wang
ebd1e6eaac Add total_chunknum to fileinfo. 2018-10-09 00:53:46 -04:00
Yuxin Wang
22c1e9358e Merge the chunknum with the possessed chunk list. 2018-10-09 00:46:42 -04:00
Yuxin Wang
97d7f143cc Add more notes. 2018-10-09 00:46:20 -04:00
Yuxin Wang
7f62307a3a Cleanup peers information when disconnected. 2018-10-09 00:26:42 -04:00
Yuxin Wang
4bd802fdc8 Merge branch 'fix-resource-warning', stop the peers and tracker more gracefully. 2018-10-08 23:45:37 -04:00
Yuxin Wang
322fa8b6cb Add todos. 2018-10-08 23:45:25 -04:00
Yuxin Wang
09000eafc1 Wrap the peer connection in finally block. 2018-10-08 22:56:45 -04:00
Yuxin Wang
85f07388a4 Close connection to server when stop() is called. 2018-10-08 22:56:13 -04:00
Yuxin Wang
0efec20ba9 Remove close writer in tracker class.
Base class MessageServer will take care of closes.
2018-10-08 22:55:50 -04:00
Yuxin Wang
29153c45a6 Spawn 2 peers instead of 3. 2018-10-08 22:55:19 -04:00
Yuxin Wang
c1b86e4779 Remove unnecessary code. 2018-10-08 21:36:35 -04:00
Yuxin Wang
0646559d51 Merge branch 'refactor-tests', use pytest-asyncio to run tests asynchrounously. 2018-10-08 21:32:21 -04:00
Yuxin Wang
527c1f2443 Use pytest-asyncio to run test asynchrounouly.
Isolate each test_ functions.
2018-10-08 21:29:51 -04:00
Yuxin Wang
0753e266d6 Fix typo. 2018-10-08 19:02:31 -04:00
Yuxin Wang
bb8fccd696 Add some tests for terminal. 2018-10-08 17:00:19 -04:00
Yuxin Wang
77fa487a2a Merge branch 'refactor-tests', split the test_core into multiple functions. 2018-10-08 14:18:43 -04:00
Yuxin Wang
451d43e3bf Add test for publish_refusal. 2018-10-08 14:10:39 -04:00
Yuxin Wang
04f6c67afe Fix typo. 2018-10-08 14:09:52 -04:00
Yuxin Wang
f9eccc6c99 Assert on the result of publish. 2018-10-08 14:09:11 -04:00
Yuxin Wang
0c0969f603 Use pre-defined file sizes to do assert. 2018-10-08 14:08:30 -04:00
Yuxin Wang
554a8e5ac3 Fix name mismatch. 2018-10-08 14:02:32 -04:00
Yuxin Wang
79d4e3b399 Rename test_main to test_core. 2018-10-08 14:00:59 -04:00
Yuxin Wang
1df02a4936 Split the test into multiple functions. 2018-10-08 14:00:45 -04:00
Yuxin Wang
8b1f4c6b7c Add conftest to create and delete test files on session level. 2018-10-08 13:51:02 -04:00
Yuxin Wang
d050403e68 Add description. 2018-10-08 11:42:00 -04:00
Yuxin Wang
6f754a526b Fix print bugs. 2018-10-08 11:39:43 -04:00
Yuxin Wang
aa50a1abe5 Use beautiful table instead of tabulate. 2018-10-08 11:30:05 -04:00
Yuxin Wang
be23ce47f9 Add notes for peers variable. 2018-10-08 11:28:02 -04:00
Yuxin Wang
ae6330cafa Unpack the list to arguments. 2018-10-08 10:41:25 -04:00
Yuxin Wang
ea33442949 asyncio.gather needs ordered data structure. 2018-10-08 10:34:39 -04:00
Yuxin Wang
1c87df92c0 Add try except to catch KeyboardInterrupt. 2018-10-07 23:29:25 -04:00
Yuxin Wang
e1f38dcd76 Add test for downloading from multiple peers. 2018-10-07 23:27:22 -04:00
Yuxin Wang
0651c43da3 Use tuple to represent multiple peers. 2018-10-07 23:19:37 -04:00
Yuxin Wang
d8506c20f6 Schedule request tasks concurrently. 2018-10-07 23:12:09 -04:00
Yuxin Wang
5d2845bcf4 Rename the variable for better readablity. 2018-10-07 22:54:48 -04:00
Yuxin Wang
a800ed03be Merge branch 'use-async-cmd', design a customized async Cmd class. 2018-10-07 22:46:50 -04:00
Yuxin Wang
e6a4b90022 Use bold font for prompt. 2018-10-07 22:46:40 -04:00
Yuxin Wang
2194175d95 Run the async cmdloop. 2018-10-07 22:13:26 -04:00
Yuxin Wang
3315413087 Make Terminal class asynchrounous. 2018-10-07 22:12:35 -04:00
Yuxin Wang
2cc0a2f756 Design an asynchrounous Cmd class. 2018-10-07 22:12:18 -04:00
Yuxin Wang
27cb06aa17 Add aioconsole for ainput method. 2018-10-07 22:11:53 -04:00
Yuxin Wang
35007a1dea Use uvloop on main method. 2018-10-07 15:40:56 -04:00
Yuxin Wang
dc6c44c7e3 Change import order to comply with PEP. 2018-10-07 12:23:27 -04:00
Yuxin Wang
a3e57df658 Merge branch 'use-asyncio', adopt asyncio in core package. 2018-10-07 12:18:37 -04:00
Yuxin Wang
4d87399718 Remove log print of thread id. 2018-10-07 12:09:42 -04:00
Yuxin Wang
3ff1d10a41 Reschedule the read message task when it is done. 2018-10-07 12:09:30 -04:00
Yuxin Wang
d76e2bc128 Fix typo. 2018-10-07 12:08:07 -04:00
Yuxin Wang
49bb02bbab Store server varibale to be closed on stop(). 2018-10-07 12:08:01 -04:00
Yuxin Wang
c0fba12bdc Run peer and tracker stop asynchronously. 2018-10-07 12:07:18 -04:00