Commit Graph

38 Commits

Author SHA1 Message Date
Jonathan de Jong
b1248ff315 enforced f-strings everywhere, %s on logging
extended _multiaddr_from_socket to support UDP and IPv6 automatically
changed TCPListener to use _ip4_or_6_from_multiaddr to get host, and not ip4 only

enforced `from error` everywhere with raises
added call braces to exceptions
2019-12-19 17:31:18 +01:00
Alex Stokes
11db313b17
A mux can provide the protocols it responds to 2019-11-06 11:41:27 -08:00
Piper Merriam
ded3792924
Merge pull request #331 from dmuhs/fix/docs-format
Add automatic docstring formatting
2019-10-28 09:39:52 -06:00
Dominik Muhs
bafdd8512d Enforce pre-summary newline in docstrings 2019-10-24 20:10:45 +02:00
Dominik Muhs
4bda366bb8 Rename protocol muxer initiator flags 2019-10-24 19:25:09 +02:00
Alex Stokes
d0c8b7d8af
Avoid sharing default dictionary argument across all instances of class 2019-10-24 17:29:16 +09:00
Alex Stokes
c92bade815
Add "default protocols" that all hosts have by default 2019-10-24 17:29:16 +09:00
Dominik Muhs
eef505f2d9 Add automatic docstring formatter and apply 2019-10-24 08:41:10 +02:00
Alex Stokes
ada4d48b6e
remove overly verbose comments 2019-09-24 15:36:50 -07:00
mhchia
95ae718e3d
Raise ParseError in read_delim 2019-09-23 16:01:22 +08:00
NIC619
7fc958e7be
Add exception raised to docstring 2019-09-19 22:19:36 +08:00
NIC619
c6294ad19b
Raise MultiselectCommunicatorError:
when failed to write to communicator
2019-09-19 21:51:23 +08:00
NIC619
eaa74c4e26
Handle MultiselectCommunicatorError 2019-09-15 16:58:22 +08:00
NIC619
879f193aa1
Handle errors from
- `read_delim`
    - `read_varint_prefixed_bytes`
    - `decode_uvarint_from_stream`
2019-09-15 16:58:08 +08:00
NIC619
905a473ac3
Add MultiselectCommunicatorError 2019-09-15 16:37:37 +08:00
NIC619
501513b747
Update IMultiselectClient 2019-09-14 22:24:53 +08:00
NIC619
65a48d5c51
Remove unused select_protocol_or_fail 2019-09-14 17:42:18 +08:00
mhchia
10415cb956
Use ReadWriteCloser for conns and streams 2019-09-05 23:24:17 +08:00
mhchia
16a4fd33c1
PR feedbacks
- Move exceptions to exceptions.py
- Raise `UpgradeFailure` in upgrader
- Refine the try/catch for upgraders in swarm
2019-08-22 22:53:49 +08:00
mhchia
ef476e555b
Use RawConnection.read
Instead of accessing its reader and writer directly.

TODO: considering add `ReaderWriterCloser` interface and let connection
and stream inherit from it.
2019-08-22 22:53:48 +08:00
mhchia
0b466ddc86
Add lock to RawConnection
To avoid `self.writer.drain()` is called in parallel.
Reference: https://bugs.python.org/issue29930
2019-08-22 22:53:47 +08:00
mhchia
5768daa9bf
PR feedbacks
- Nits
- Add `SecurityUpgradeFailure` and handle `UpgradeFailure` in Swarm.
2019-08-22 22:53:47 +08:00
mhchia
bb7d37fd4f
Fix msg encoding
- Change varint-prefix encode to fixedint-prefix(4 bytes) encode.
2019-08-22 22:53:46 +08:00
mhchia
a0923d202a
Move varint and delim read/write to toplevel
To `libp2p.utils`.
2019-08-22 22:53:46 +08:00
mhchia
86d4ce1da8 Add delim_encode and delim_read
- Add `StreamCommunicator` and `RawConnectionCommunicator`, read/write
messages with delim codec, with `IMuxedStream` and `IRawConnection`
respectively.
- Use it in `Multiselect` and `MultiselectClient`.
2019-08-18 19:51:04 +08:00
Alex Stokes
3debd2c808
Run black and isort w/ the new config 2019-08-13 14:36:42 -07:00
Chih Cheng Liang
dbb702548f add NegotiableTransport type 2019-08-08 16:09:02 +08:00
Chih Cheng Liang
c536aa3e07 flake8 2019-08-08 16:09:02 +08:00
Chih Cheng Liang
5903012e0e add typing to protocol_muxer 2019-08-08 16:09:02 +08:00
Alex Stokes
c8005c8113 Run isort in repo 2019-08-03 17:50:14 +08:00
Alex Stokes
0ae9840928
Run black over repo 2019-07-31 15:00:12 -07:00
Stuckinaboot
867f3a70f6 Modify stream to be reader_writer 2019-05-07 01:31:54 -04:00
Stuckinaboot
f59f27d4d0 Integrate security selectin into libp2p system 2019-04-30 03:09:05 -04:00
Stuckinaboot
745c5e677c Fix outstanding unrelated lint issue in multiselect_client 2019-03-15 11:22:20 -04:00
Stuckinaboot
58bdee499b Fix linting issue 2019-03-15 11:22:20 -04:00
Robert Zajac
82840b5e6c
Stream rearchitecture (#126)
* Add generic protocol handler

* Add generic protocol handler to stream muxing pipeline

* Modify conn_handler to only deal with connections

* mplex accept stream architecture changes

* Add create generic protocol handler

* Fix minor bugs

* who would win 4 devs or one not

* Debugging

* rearch with handle_incoming infinite loop, seems to work, needs cleanup"

* passing linting, still needs cleanup

* fixing linting again; code still needs cleanup

* fixing tests; code still needs cleanup

* adding test cleanup and task cleanup, removing prints

* linting, and cleanup complete

* storing connections based on peer id

* remove dead code

* remove unnecessary peer_id
2019-02-24 20:58:23 -05:00
zixuanzh
71a6b868e1 fix merge conflicts 2019-01-10 20:45:03 +08:00
Alexander Koshkin
ce6ddb27a9 Migrate to new project structure. 2019-01-09 21:38:56 +03:00