Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Julien David
rdos
Commits
4427d873
Commit
4427d873
authored
Sep 17, 2020
by
Ismail Moumni
Browse files
editing
parent
3c921e5f
Pipeline
#707
failed with stage
in 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
softwares/server/server.py
View file @
4427d873
...
...
@@ -32,14 +32,13 @@ class RdosServer:
data
=
conn
.
recv
(
4096
)
query
=
(
json
.
loads
(
data
.
decode
(
'utf-8'
)))
print
(
query
)
if
query_valid
(
query
):
match
=
verif_param
(
query
)
if
match
==
query
:
print
(
"ok"
)
conn
.
send
(
bytes
(
json
.
dumps
(
match
),
"utf-8"
))
else
:
print
(
'Erreur query : '
)
conn
.
send
(
bytes
(
json
.
dumps
(
match
),
"utf-8"
))
match
=
verif_param
(
query
)
if
match
==
query
:
print
(
"ok"
)
conn
.
send
(
bytes
(
json
.
dumps
(
match
),
"utf-8"
))
else
:
print
(
'Erreur query : '
)
conn
.
send
(
bytes
(
json
.
dumps
(
match
),
"utf-8"
))
# Function query_valwid matches the query send from client side
...
...
@@ -60,8 +59,8 @@ def query_valid(data: dict):
# Function output returns a new dictionary containing arguments
# # for db query and list of tools
def
send_param_client
(
__RDOS_Dict__
:
dict
,
__RDOS_Tools__
:
list
):
#
req = db.getParameters()
pass
req
=
db
.
getParameters
()
return
req
# Function json_loads changes a json file into a Dict
...
...
Write
Preview
Supports
Markdown
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