This commit is contained in:
2025-11-09 14:32:02 +01:00
parent bc12f86598
commit 8d56a32bd1
3 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
CFLAGS = -Wall -Wextra -ggdb -fsanitize=address,undefined CFLAGS = -Wall -Wextra -ggdb
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
LFLAGS = -lws2_32 LFLAGS = -lws2_32
+1 -1
View File
@@ -15,7 +15,7 @@ int main(int argc, char **argv)
// TODO: set simulation_should_stop=true on ctrl+C // TODO: set simulation_should_stop=true on ctrl+C
startup_simulation(1); startup_simulation(2);
// Spawn metadata server (leader) // Spawn metadata server (leader)
spawn_simulated_process("--addr 127.0.0.1 --port 8080 --leader"); spawn_simulated_process("--addr 127.0.0.1 --port 8080 --leader");
+3 -4
View File
@@ -631,15 +631,14 @@ void update_simulation(void)
{ {
Descriptor *peer = handle_to_desc(desc->connection_peer); Descriptor *peer = handle_to_desc(desc->connection_peer);
if (peer == NULL) { if (peer == NULL) {
assert(0); // TODO revents |= POLLIN;
} } else {
if (!data_queue_full(&desc->output_data)) if (!data_queue_full(&desc->output_data))
revents |= POLLOUT; revents |= POLLOUT;
if (!data_queue_empty(&peer->output_data)) if (!data_queue_empty(&peer->output_data))
revents |= POLLIN; revents |= POLLIN;
} }
}
break; break;
case CONNECTION_FAILED: case CONNECTION_FAILED: