Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
9ff123be
Commit
9ff123be
authored
Jan 09, 2017
by
Daniel Salzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python/control: fix incomplete block read if error
parent
94dbffdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
python/libknot/control.py
python/libknot/control.py
+13
-2
No files found.
python/libknot/control.py
View file @
9ff123be
...
...
@@ -360,6 +360,7 @@ class KnotCtl(object):
"""
out
=
dict
()
err_reply
=
None
while
True
:
reply
=
KnotCtlData
()
...
...
@@ -371,10 +372,14 @@ class KnotCtl(object):
# Check for an error.
if
reply
[
KnotCtlDataIdx
.
ERROR
]:
raise
KnotCtlError
(
reply
[
KnotCtlDataIdx
.
ERROR
],
reply
)
err_reply
=
reply
continue
self
.
_receive_stats
(
out
,
reply
)
if
err_reply
:
raise
KnotCtlError
(
err_reply
[
KnotCtlDataIdx
.
ERROR
],
err_reply
)
return
out
def
receive_block
(
self
):
...
...
@@ -384,17 +389,20 @@ class KnotCtl(object):
"""
out
=
dict
()
err_reply
=
None
while
True
:
reply
=
KnotCtlData
()
reply_type
=
self
.
receive
(
reply
)
# Stop if not data type.
if
reply_type
not
in
[
KnotCtlType
.
DATA
,
KnotCtlType
.
EXTRA
]:
break
# Check for an error.
if
reply
[
KnotCtlDataIdx
.
ERROR
]:
raise
KnotCtlError
(
reply
[
KnotCtlDataIdx
.
ERROR
],
reply
)
err_reply
=
reply
continue
# Check for config data.
if
reply
[
KnotCtlDataIdx
.
SECTION
]:
...
...
@@ -408,4 +416,7 @@ class KnotCtl(object):
else
:
continue
if
err_reply
:
raise
KnotCtlError
(
err_reply
[
KnotCtlDataIdx
.
ERROR
],
err_reply
)
return
out
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