We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 920af6b commit e3d9973Copy full SHA for e3d9973
src/server.c
@@ -199,11 +199,11 @@ int server(char *config_file)
199
}
200
201
202
- printf("Created new connection with ID %d\n", num_connections);
203
- connections[num_connections].id = connection_id_counter++;
204
- connections[num_connections].addr = client_addr;
+ connection_index = num_connections;
+ connections[connection_index].id = connection_id_counter++;
+ connections[connection_index].addr = client_addr;
205
num_connections++;
206
- connection_index = num_connections - 1;
+ printf("Created new connection with ID %d\n", connections[connection_index].id);
207
208
209
// Update the last activity time
0 commit comments