minor fix

This commit is contained in:
Aryan Singh committed 2026-09-12 19:59:00 -05:00
1 parent 249f0b844b
commit cc539814d8
2 files changed
+4 -3

No files matched your search

+2 -1
View File
@@ -27,7 +27,7 @@ def receive_exact(sock, num_bytes):
while len(received_data) < num_bytes: while len(received_data) < num_bytes:
chunk = sock.recv(num_bytes - len(received_data)) chunk = sock.recv(num_bytes - len(received_data))
if not chunk: if not chunk:
break raise ConnectionError("connection closed before the full message arrived")
received_data += chunk received_data += chunk
return received_data return received_data
@@ -62,6 +62,7 @@ def grep_all_ips(ips, cmd):
except Exception as e: except Exception as e:
print(f"Failed to connect to {ip}:{PORT} - {e}") print(f"Failed to connect to {ip}:{PORT} - {e}")
match_count.append(0)
finally: finally:
client_socket.close() client_socket.close()
+2 -2
View File
@@ -25,7 +25,7 @@ def receive_exact(sock, num_bytes):
while len(received_data) < num_bytes: while len(received_data) < num_bytes:
chunk = sock.recv(num_bytes - len(received_data)) chunk = sock.recv(num_bytes - len(received_data))
if not chunk: if not chunk:
break raise ConnectionError("connection closed before the full message arrived")
received_data += chunk received_data += chunk
return received_data return received_data
@@ -56,7 +56,7 @@ while True:
command_args.insert(1, "-n") command_args.insert(1, "-n")
result = subprocess.run(command_args, capture_output=True, text=True) result = subprocess.run(command_args, cwd="~/fa26_cs425_.group-mp_.team-01/MP1" capture_output=True, text=True)
send_message(conn, result.stdout + result.stderr) send_message(conn, result.stdout + result.stderr)