Server functionality

This commit is contained in:
Yannik Schmidt
2018-08-20 05:55:49 +02:00
parent 0d9d0a1e53
commit 7ba9b7d016
2 changed files with 37 additions and 4 deletions

View File

@@ -1,3 +1,28 @@
def parse_request(data):
''' parse request and call correct function '''
# echo/test connection
cleared_data = is_data_type(b"ECHOREQUEST,",data)
if cleared_data:
return cleared_data
# other shit
return b"UNRECOGNIZED_SERVER_OPTION\n"
def is_data_type(tag,data):
print(data)
print(tag)
data = data.strip(b"\n")
if data.startswith(tag):
ret = data.strip(tag)
if not ret:
ret = b"NULL\n"
return ret
return None
def reply_logs(loglevel=0,lines=100):
''' replies with recent logs '''
pass