diff --git a/src/algo_rr.c b/src/algo_rr.c index 3872012..c4136cc 100644 --- a/src/algo_rr.c +++ b/src/algo_rr.c @@ -121,6 +121,12 @@ void rr_pkt_register(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, if (bp->ip.ap.str.id > rr->my_links_ver) { rr->my_links = bp->ip.ap.str.bitfield; rr->my_links_ver = bp->ip.ap.str.id; + printf("Links availability: ["); + for (int i = 0; i < 8; i++) { + if (rr->my_links & 1 << i) printf("U"); + else printf("-"); + } + printf("]\n"); } // 2. If packet arrived too late, we discard it @@ -385,7 +391,7 @@ int rr_on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { printf("Timer reached for packet %d\n", pkt->id); // !BLACKLIST LINK - //rr->remote_links &= 0xffff ^ 1 << pkt->link_num; + rr->remote_links &= 0xff ^ 1 << pkt->link_num; while (ring_lt(rr->recv_id, pkt->id)) { rr->recv_id++; diff --git a/src/donar_client.c b/src/donar_client.c index 3fd089c..32bf02e 100644 --- a/src/donar_client.c +++ b/src/donar_client.c @@ -47,7 +47,7 @@ failed: int on_socks5_failed(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { struct donar_client_ctx* app_ctx = fdinfo->cat->app_ctx; struct socks5_ctx* s5ctx = fdinfo->other; - int pos = 7500 - s5ctx->port; + int pos = s5ctx->port - 7500; evt_core_rm_fd (ctx, fdinfo->fd); init_socks5_client (app_ctx, pos);