Alex Stokes
a193ae81fd
Fix typo w/ header tag under different reset scenarios
2019-08-26 11:39:30 -07: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
550c23f9f9
PR feedback
...
- Use the order in `MuxerMultistream` as the precedence in multiselect
2019-08-21 11:43:25 +08:00
mhchia
8596f7390f
PR feedback: set protocol_id to constants
2019-08-21 11:43:24 +08:00
mhchia
d7d8440b2c
PR feedback: nitpicks
2019-08-21 11:43:24 +08:00
mhchia
4358a4bc89
Negotiate multiselect version for Muxer
...
`MuxerMultistream` is introduced to negotiate `Multiselect` version
before negotiating Multiplexer's version. This is required by
multistream 1.x
2019-08-21 11:43:24 +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
mhchia
c5f32bf431
PR feedback for MplexStream.read
2019-08-16 11:03:16 +08:00
Kevin Mai-Husan Chia
8699568d43
Update libp2p/stream_muxer/mplex/mplex_stream.py
...
Co-Authored-By: Alex Stokes <r.alex.stokes@gmail.com>
2019-08-16 11:03:16 +08:00
mhchia
b27cd0f24f
Use bytearray
over bytes
...
To avoid copies.
2019-08-16 11:03:16 +08:00
mhchia
92320523d5
Add the missing exceptions.py
2019-08-16 11:03:16 +08:00
mhchia
e37b8bcf19
mypy: Add read_buffer_nonblocking
in Mplex
2019-08-16 11:03:16 +08:00
mhchia
f281e3e1db
flake8
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
mhchia
2485a00e24
Modify NetStream
to read n bytes
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
Chih Cheng Liang
cb3a59e0ac
ttl as int
2019-08-05 17:02:18 +08:00
Chih Cheng Liang
e763f57930
run isort
2019-08-05 11:47:23 +08:00
Chih Cheng Liang
7a04ebb51f
run black
2019-08-05 11:21:20 +08:00
Chih Cheng Liang
9e0a806218
move stream and connection interfaces to abc
2019-08-05 11:17:38 +08:00
Chih Cheng Liang
29091266fc
add still needed TYPE_CHECK
2019-08-05 10:46:49 +08:00
Chih Cheng Liang
87ef2e4618
remove if TYPE_CHECKING as much as possible
2019-08-05 10:46:49 +08:00
Chih Cheng Liang
4c9a930f84
stream_muxer done
2019-08-05 10:45:47 +08:00
Chih Cheng Liang
dadac423f2
typed muxed_connection_interface.py
2019-08-05 10:45:47 +08:00
Chih Cheng Liang
b64ed9fd6f
typed mplex.utils
2019-08-05 10:45:46 +08:00
Chih Cheng Liang
239a5c88fb
add typing to mplex
2019-08-05 10:45:46 +08:00
Chih Cheng Liang
36b7e8ded9
Refactor HeaderTags
2019-08-05 10:45:46 +08:00
Alex Stokes
7477b29508
run black w/ extended line length
2019-08-04 12:37:41 +08:00
Alex Stokes
c8005c8113
Run isort
in repo
2019-08-03 17:50:14 +08:00
Alex Stokes
28e1a03dc4
remove empty yamux impl
2019-08-02 15:03:59 -07:00
mhchia
2e94fcf56c
Remove pylint:disable
2019-08-02 23:26:06 +08:00
Alex Stokes
0ae9840928
Run black
over repo
2019-07-31 15:00:12 -07:00
NIC619
5e215901c0
Apply PR feedback
2019-07-30 23:41:28 +08:00
NIC619
c4105688d1
Fix after rebase
2019-07-30 17:31:08 +08:00
NIC619
e53727d301
Apply PR feedback: fix type hints
2019-07-30 16:28:25 +08:00