Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
nexedi
nemu3
Commits
c922e55a
Commit
c922e55a
authored
Jul 02, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more bugs; allow empty b64 parameters
parent
c706e136
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/netns/protocol.py
src/netns/protocol.py
+5
-5
t/test_protocol.py
t/test_protocol.py
+1
-1
No files found.
src/netns/protocol.py
View file @
c922e55a
...
...
@@ -201,9 +201,9 @@ class Server(object):
try
:
if
args
[
i
][
0
]
==
'='
:
args
[
i
]
=
base64
.
b64decode
(
args
[
i
][
1
:])
if
len
(
args
[
i
])
==
0
:
self
.
reply
(
500
,
"Invalid parameter: empty."
)
return
None
#
if len(args[i]) == 0:
#
self.reply(500, "Invalid parameter: empty.")
#
return None
except
TypeError
:
self
.
reply
(
500
,
"Invalid parameter: not base-64 encoded."
)
return
None
...
...
@@ -463,7 +463,7 @@ class Client(object):
params
=
[]
for
k
,
v
in
env
.
items
():
params
.
extend
([
_b64
(
k
),
_b64
(
v
)])
self
.
_send_cmd
(
"PROC"
,
"ENV"
,
params
)
self
.
_send_cmd
(
"PROC"
,
"ENV"
,
*
params
)
self
.
_read_and_check_reply
()
if
stdin
!=
None
:
...
...
@@ -478,7 +478,7 @@ class Client(object):
raise
self
.
_send_cmd
(
"PROC"
,
"RUN"
)
pid
=
self
.
_read_and_check_reply
().
split
()[
0
]
pid
=
int
(
self
.
_read_and_check_reply
().
split
()[
0
])
return
pid
...
...
t/test_protocol.py
View file @
c922e55a
...
...
@@ -103,7 +103,7 @@ class TestServer(unittest.TestCase):
check_ok
(
self
,
"proc wait 0"
,
None
,
[
0
])
check_ok
(
self
,
"proc kill 0"
,
None
,
[
0
])
check_
error
(
self
,
"proc crte ="
)
# empty b64
check_
ok
(
self
,
"proc crte ="
,
srv
.
do_PROC_CRTE
,
[
""
]
)
# empty b64
check_error
(
self
,
"proc crte =a"
)
# invalid b64
# simulate proc mode
...
...
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