diff --git a/Makefile b/Makefile index 0ffbde1..d282153 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -CFLAGS = -Wall -Wextra -ggdb -fsanitize=address,undefined +CFLAGS = -Wall -Wextra -ggdb ifeq ($(OS),Windows_NT) LFLAGS = -lws2_32 diff --git a/src/main_test.c b/src/main_test.c index 7fe46b6..294a0e7 100644 --- a/src/main_test.c +++ b/src/main_test.c @@ -15,7 +15,7 @@ int main(int argc, char **argv) // TODO: set simulation_should_stop=true on ctrl+C - startup_simulation(1); + startup_simulation(2); // Spawn metadata server (leader) spawn_simulated_process("--addr 127.0.0.1 --port 8080 --leader"); diff --git a/src/system.c b/src/system.c index 7afb89c..73adcfc 100644 --- a/src/system.c +++ b/src/system.c @@ -631,14 +631,13 @@ void update_simulation(void) { Descriptor *peer = handle_to_desc(desc->connection_peer); if (peer == NULL) { - assert(0); // TODO - } - - if (!data_queue_full(&desc->output_data)) - revents |= POLLOUT; - - if (!data_queue_empty(&peer->output_data)) revents |= POLLIN; + } else { + if (!data_queue_full(&desc->output_data)) + revents |= POLLOUT; + if (!data_queue_empty(&peer->output_data)) + revents |= POLLIN; + } } break;