Alex Stokes
4b01c33d54
add some additional logging
2019-11-07 20:57:43 -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
5810174374
Rename stream muxer initiator flags
2019-10-24 19:28:19 +02:00
Dominik Muhs
031b98ddf0
Rename stream muxer initiator flags
2019-10-24 19:25:34 +02:00
Dominik Muhs
eef505f2d9
Add automatic docstring formatter and apply
2019-10-24 08:41:10 +02:00
mhchia
6f8394e4bd
Merge branch 'master' into fix/change-notifee-and-add-tests-for-swarm-conn-and-mplex
2019-09-21 18:34:12 +08:00
mhchia
539047be2d
Make mplex.read_message
handle RawConnError
2019-09-21 18:17:00 +08:00
mhchia
e44c2145cc
Merge branch 'master' into fix/detection-of-close
2019-09-21 18:05:54 +08:00
mhchia
89c127eff4
Merge branch 'master' into fix/refactor-mplex-swarm-host
2019-09-20 15:45:28 +08:00
mhchia
02c55e5d14
Add tests for MplexConn
2019-09-19 16:31:42 +08:00
mhchia
a9ad37bc6f
Add mplex tests and fix error in SwarmConn.close
2019-09-19 16:31:41 +08:00
mhchia
5f064dd329
Refactor: get rid of single huge _handle_incoming
2019-09-19 15:55:27 +08:00
mhchia
b51c2939a8
Handle exceptions inside read_message
...
And remove the need of checking `None` for every read messages.
2019-09-19 15:55:26 +08:00
mhchia
f62f07bb9f
Handle IncompleteRead
in handle_incoming
2019-09-19 15:55:26 +08:00
mhchia
2d8e02b7eb
Add detection for disconnections in mplex
2019-09-19 15:55:26 +08:00
mhchia
393b51a744
isort
2019-09-19 15:53:40 +08:00
mhchia
5653b3f604
Add "closed" and "shutting_down" events
2019-09-19 15:53:39 +08:00
mhchia
7cf0495f37
Remove print
2019-09-19 15:38:38 +08:00
mhchia
0bd213bbb7
Refactor mplex and start to add close detection
2019-09-19 13:56:05 +08:00
NIC619
559f419b4e
Fix stream registration in accept_stream
2019-09-17 15:42:18 +08:00
NIC619
76af835af8
Handle MultiselectError
in stream_muxer.accept_stream
2019-09-15 17:35:01 +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
mhchia
be2c0f122a
Fix close behavior
2019-09-10 18:01:14 +08:00
mhchia
6c1f77dc1a
Fix: Change the event.close
to event.set
...
And add missing parts.
2019-09-06 21:35:15 +08:00
mhchia
207fa75d8f
Add reset
and close
2019-09-05 23:44:22 +08:00
mhchia
eac159c527
Restructure mplex and mplex_stream
2019-09-05 22:29:33 +08:00
mhchia
96230758e4
Add events in MplexStream
...
And modify a little bit of `close` and `reset`
2019-09-05 18:18:39 +08:00
mhchia
c61a06706a
Refactor interop tests and factories
...
- Add `close` and `disconnect` in `Host`
- Add `close` and `close_peer` in `Network`
- Change `IListener.close` to async, to await for server's closing
- Add factories for security transports, and modify `HostFactory`
2019-08-29 21:38:06 +08:00
mhchia
d35b8ffc64
Conform stream_id
to go-mplex
2019-08-28 21:43:34 +08:00
mhchia
b6c8ab0dc9
Fix #259 : Use the unsigned LEB128 impl from py-wasm
...
Reference: https://github.com/ethereum/py-wasm/blob/master/wasm/parsers/leb128.py
2019-08-26 20:41:10 +08:00
mhchia
d59870ebbf
Fix MplexStream
error
...
When receiving a `NewStream`, the message of that packet is the
name of the stream, which should be handled, rather than letting it go
into the message queue.
2019-08-26 20:39:08 +08:00
NIC619
5e68aff1d1
Fix conn
attribute and docstring in mplex
2019-08-25 14:42:44 +08:00
Alex Stokes
5b32bfdd3f
Add call to wait_closed
method of asyncio.StreamWriter
2019-08-24 22:06:24 +02:00
Alex Stokes
9c5fb4fa5a
Encapsulate concept of a "stream id" to a "muxed" connection
2019-08-24 21:50:07 +02:00
Alex Stokes
e29c1507bf
remove unused fields
2019-08-24 21:50:06 +02: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
22b1a5395d
A working plaintext 2.0 without validation
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
7bc363f2fa
Remove initiator in Mplex
...
Besides, fix the wrong passed `multi_addr` to `mplex_stream`.
2019-08-22 22:53:45 +08:00
mhchia
8596f7390f
PR feedback: set protocol_id to constants
2019-08-21 11:43:24 +08:00
mhchia
c5f32bf431
PR feedback for MplexStream.read
2019-08-16 11:03:16 +08:00
mhchia
9f8276fa84
Support read(n=-1)
...
Now, `n=-1` indicates that we want to read until EOF. However, now we
only read until we have no new message.
2019-08-16 11:03:16 +08:00
mhchia
9cb6ec1c48
Modify the behavior of MplexStream.read
2019-08-16 11:03:16 +08:00
Alex Stokes
82bae341a7
Run isort over files that were missing it
2019-08-15 16:33:35 -07:00
Alex Stokes
0ebc8ffb21
Wire some missing properties up
2019-08-15 16:33:34 -07:00
Alex Stokes
1e5357a1e1
Update the ISecureConn
interface following the reference and simplify accordingly
2019-08-15 16:33:33 -07:00
Alex Stokes
3debd2c808
Run black
and isort
w/ the new config
2019-08-13 14:36:42 -07:00
Chih Cheng Liang
28f6de37ee
Fix the rest of the typing hints ( #232 )
...
* ignore kad
* fix swarm, and minor
* fix init and swarm
* ignore pb
* enable mypy
* fix basic host
* fix tcp
* fix mplex
* add typing for pb
* skip format pyi
* [mypy] no need to ignore pb now
* add typing to chat
2019-08-11 16:47:54 +08:00