diff --git a/scripts/rrh-client b/scripts/rrh-client index f9c6805..ed4f117 100755 --- a/scripts/rrh-client +++ b/scripts/rrh-client @@ -3,7 +3,7 @@ mkdir -p ./log tor -f /etc/torrc > ./log/client-tor-stdout.log 2> ./log/client-tor-stderr.log & sleep 2 mkdir -p ./shared -donar -a rr -b -h -c -o ./shared/onion_services.pub -r 9000 > ./log/client-donar-stdout.log 2> ./log/client-donar-stderr.log & +valgrind --leak-check=full donar -a rr -b -h -c -o ./shared/onion_services.pub -r 9000 > ./log/client-donar-stdout.log 2> ./log/client-donar-stderr.log & sleep 2 measlat -h 127.13.3.7 -p 9000 > /dev/null 2>&1 # Used to wait for connections measlat -h 127.13.3.7 -p 9000 -c $1 -i $2 -s $3 > ./res/rrh.csv 2> ./log/client-measlat-stderr.log diff --git a/scripts/rrh-server b/scripts/rrh-server index e0db554..49a27a4 100755 --- a/scripts/rrh-server +++ b/scripts/rrh-server @@ -5,5 +5,5 @@ sleep 2 mkdir -p ./shared cd ./shared pwd -donar -a rr -b -h -s -e 9000 > ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log & +valgrind --leak-check=full donar -a rr -b -h -s -e 9000 > ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log & udpecho -p 9000 > ../log/server-udpecho-stdout.log 2> ../log/server-udpecho-stderr.log diff --git a/src/evt_core.c b/src/evt_core.c index 04d7bba..3d57261 100644 --- a/src/evt_core.c +++ b/src/evt_core.c @@ -3,8 +3,15 @@ void free_fdinfo(void* v) { struct evt_core_fdinfo* fdinfo = (struct evt_core_fdinfo*)v; close(fdinfo->fd); // We close the file descriptor here - if (fdinfo->url != NULL) free(fdinfo->url); // We free the URL here; - if (fdinfo->free_other != NULL) fdinfo->free_other(fdinfo->other); + fprintf(stderr, "Freeing fdinfo for %s\n", fdinfo->url); + if (fdinfo->free_other != NULL) { + fprintf(stderr, "Freeing fdinfo->other for %s\n", fdinfo->url); + fdinfo->free_other(fdinfo->other); + } + if (fdinfo->url != NULL) { + fprintf(stderr, "Freeing fdinfo->url for %s\n", fdinfo->url); + free(fdinfo->url); // We free the URL here; + } free(v); } @@ -159,8 +166,9 @@ struct evt_core_cat* evt_core_rm_fd(struct evt_core_ctx* ctx, int fd) { g_hash_table_remove(ctx->socklist, &fd); // Will be free here // 4. Close and remove file descriptor - epoll_ctl(ctx->epollfd, EPOLL_CTL_DEL, fd, NULL); - close(fd); + // Done in free_fdinfo + //epoll_ctl(ctx->epollfd, EPOLL_CTL_DEL, fd, NULL); + //close(fd); // 5. Return file descriptor's category return cat;