Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
2440da7c
Commit
2440da7c
authored
Mar 11, 2022
by
dieter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #150
parent
0a8d2316
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
CHANGES.rst
CHANGES.rst
+3
-0
src/ZEO/asyncio/base.py
src/ZEO/asyncio/base.py
+3
-0
src/ZEO/asyncio/tests.py
src/ZEO/asyncio/tests.py
+28
-0
No files found.
CHANGES.rst
View file @
2440da7c
...
...
@@ -4,6 +4,9 @@ Changelog
5.2.4 (unreleased)
------------------
- Fix bug related to blobs stored by ``ZEO``
`#150 <https://github.com/zopefoundation/ZEO/issues/150>`_.
5.2.3 (2021-08-09)
------------------
...
...
src/ZEO/asyncio/base.py
View file @
2440da7c
...
...
@@ -77,6 +77,9 @@ class Protocol(asyncio.Protocol):
# will be used with blobs, in which case, the individual
# messages will be big to begin with.
data
=
iter
(
data
)
if
paused
:
append
(
data
)
return
for
message
in
data
:
writelines
((
pack
(
">I"
,
len
(
message
)),
message
))
if
paused
:
...
...
src/ZEO/asyncio/tests.py
View file @
2440da7c
...
...
@@ -2,8 +2,12 @@ from .._compat import PY3
if
PY3
:
import
asyncio
def
to_byte
(
i
):
return
bytes
([
i
])
else
:
import
trollius
as
asyncio
def
to_byte
(
b
):
return
b
from
zope.testing
import
setupstack
from
concurrent.futures
import
Future
...
...
@@ -18,6 +22,7 @@ import unittest
from
..Exceptions
import
ClientDisconnected
,
ProtocolError
from
.base
import
Protocol
from
.testing
import
Loop
from
.client
import
ClientRunner
,
Fallback
from
.server
import
new_connection
,
best_protocol_version
...
...
@@ -869,10 +874,33 @@ class Logging(object):
logging
.
getLogger
().
setLevel
(
logging
.
NOTSET
)
class
ProtocolTests
(
setupstack
.
TestCase
):
def
setUp
(
self
):
self
.
loop
=
loop
=
Loop
()
loop
.
create_connection
(
lambda
:
Protocol
(
loop
,
None
),
sock
=
True
)
def
test_writeit
(
self
):
"""test https://github.com/zopefoundation/ZEO/issues/150."""
loop
=
self
.
loop
protocol
,
transport
=
loop
.
protocol
,
loop
.
transport
transport
.
capacity
=
1
# single message
def
it
(
tag
):
yield
tag
yield
tag
protocol
.
_writeit
(
it
(
b"0"
))
protocol
.
_writeit
(
it
(
b"1"
))
for
b
in
b"0011"
:
l
,
t
=
transport
.
pop
(
2
)
self
.
assertEqual
(
l
,
b"
\
x00
\
x00
\
x00
\
x01
"
)
self
.
assertEqual
(
t
,
to_byte
(
b
))
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
ClientTests
))
suite
.
addTest
(
unittest
.
makeSuite
(
ServerTests
))
suite
.
addTest
(
unittest
.
makeSuite
(
MsgpackClientTests
))
suite
.
addTest
(
unittest
.
makeSuite
(
MsgpackServerTests
))
suite
.
addTest
(
unittest
.
makeSuite
(
ProtocolTests
))
return
suite
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment