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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
b6ec0eca
Commit
b6ec0eca
authored
May 19, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added protocol negotiation and test fixes
parent
7e5b78fc
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
41 deletions
+59
-41
src/ZEO/asyncio/client.py
src/ZEO/asyncio/client.py
+9
-11
src/ZEO/asyncio/tests.py
src/ZEO/asyncio/tests.py
+50
-30
No files found.
src/ZEO/asyncio/client.py
View file @
b6ec0eca
...
...
@@ -32,6 +32,8 @@ class Protocol(asyncio.Protocol):
transport
=
protocol_version
=
None
protocols
=
b"Z309"
,
b"Z310"
,
b"Z3101"
def
__init__
(
self
,
loop
,
addr
,
client
,
storage_key
,
read_only
,
connect_poll
=
1
):
"""Create a client interface
...
...
@@ -179,8 +181,12 @@ class Protocol(asyncio.Protocol):
# lastTid before processing (and possibly missing) subsequent
# invalidations.
self
.
protocol_version
=
protocol_version
self
.
_write
(
protocol_version
)
# XXX protocol negotiation
self
.
protocol_version
=
min
(
protocol_version
,
self
.
protocols
[
-
1
])
if
self
.
protocol_version
not
in
self
.
protocols
:
self
.
client
.
register_failed
(
self
,
ZEO
.
Exceptions
.
ProtocolError
(
protocol_version
))
return
self
.
_write
(
self
.
protocol_version
)
register
=
self
.
promise
(
'register'
,
self
.
storage_key
,
...
...
@@ -351,7 +357,7 @@ class Client:
def
disconnected
(
self
,
protocol
=
None
):
if
protocol
is
None
or
protocol
is
self
.
protocol
:
if
protocol
is
self
.
protocol
:
if
protocol
is
self
.
protocol
and
protocol
is
not
None
:
self
.
client
.
notify_disconnected
()
self
.
ready
=
False
self
.
connected
=
concurrent
.
futures
.
Future
()
...
...
@@ -544,14 +550,6 @@ class Client:
self
.
close
()
future
.
set_result
(
None
)
# Methods called by the server:
client_methods
=
(
'invalidateTransaction'
,
'serialnos'
,
'info'
,
'receiveBlobStart'
,
'receiveBlobChunk'
,
'receiveBlobStop'
,
)
client_delegated
=
client_methods
[
1
:]
def
invalidateTransaction
(
self
,
tid
,
oids
):
if
self
.
ready
:
for
oid
in
oids
:
...
...
src/ZEO/asyncio/tests.py
View file @
b6ec0eca
This diff is collapsed.
Click to expand it.
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