Update server.py
This commit is contained in:
1 parent
5e596bdef7
commit
2ec0be3a82
1 file changed
+5
-3
+5
-3
@@ -38,13 +38,15 @@ while True:
|
||||
print(f"Connected by {addr}")
|
||||
|
||||
command = receive_message(conn)
|
||||
# print("Received Grep Command:", command.decode())
|
||||
if command is None:
|
||||
conn.close()
|
||||
continue
|
||||
|
||||
command_args = shlex.split(command.decode())
|
||||
command_args = shlex.split(command)
|
||||
|
||||
if not command_args or command_args[0] != "grep":
|
||||
response = "Invalid command. Please use the 'grep' command."
|
||||
conn.sendall(response.encode())
|
||||
send_message(conn, response)
|
||||
conn.close()
|
||||
continue
|
||||
|
||||
|
||||
Reference in new issue
Block a user