Skip to content
Snippets Groups Projects
Commit 4427d873 authored by Ismail Moumni's avatar Ismail Moumni
Browse files

editing

parent 3c921e5f
No related branches found
No related tags found
1 merge request!5Adding json functions
Pipeline #707 failed with stage
in 15 seconds
...@@ -32,14 +32,13 @@ class RdosServer: ...@@ -32,14 +32,13 @@ class RdosServer:
data = conn.recv(4096) data = conn.recv(4096)
query = (json.loads(data.decode('utf-8'))) query = (json.loads(data.decode('utf-8')))
print(query) print(query)
if query_valid(query): match = verif_param(query)
match = verif_param(query) if match == query:
if match == query: print("ok")
print("ok") conn.send(bytes(json.dumps(match), "utf-8"))
conn.send(bytes(json.dumps(match), "utf-8")) else:
else: print('Erreur query : ')
print('Erreur query : ') conn.send(bytes(json.dumps(match), "utf-8"))
conn.send(bytes(json.dumps(match), "utf-8"))
# Function query_valwid matches the query send from client side # Function query_valwid matches the query send from client side
...@@ -60,8 +59,8 @@ def query_valid(data: dict): ...@@ -60,8 +59,8 @@ def query_valid(data: dict):
# Function output returns a new dictionary containing arguments # Function output returns a new dictionary containing arguments
# # for db query and list of tools # # for db query and list of tools
def send_param_client(__RDOS_Dict__: dict, __RDOS_Tools__: list): def send_param_client(__RDOS_Dict__: dict, __RDOS_Tools__: list):
# req = db.getParameters() req = db.getParameters()
pass return req
# Function json_loads changes a json file into a Dict # Function json_loads changes a json file into a Dict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment