summaryrefslogtreecommitdiffstats
path: root/src/receive.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-19 20:00:36 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-19 20:00:36 +0200
commit6798a76ffa1b4de4ec0ea07286c3510d86c0e3b6 (patch)
treea755a36afca70baaab878d391341129eb95e0873 /src/receive.c
parent2e14d72936d1ccfb6faed4a20dec7072fb6d8232 (diff)
downloadfastd-6798a76ffa1b4de4ec0ea07286c3510d86c0e3b6.tar
fastd-6798a76ffa1b4de4ec0ea07286c3510d86c0e3b6.zip
Store peers as vectors of pointers instead of linked lists
Diffstat (limited to 'src/receive.c')
-rw-r--r--src/receive.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/receive.c b/src/receive.c
index f53b263..5bbab23 100644
--- a/src/receive.c
+++ b/src/receive.c
@@ -163,7 +163,10 @@ static inline void handle_socket_receive(fastd_context_t *ctx, fastd_socket_t *s
peer = sock->peer;
}
else {
- for (peer = ctx->peers; peer; peer = peer->next) {
+ size_t i;
+ for (i = 0; i < VECTOR_LEN(ctx->peers); i++) {
+ peer = VECTOR_INDEX(ctx->peers, i);
+
if (fastd_peer_address_equal(&peer->address, remote_addr))
break;
}