Merge branch 'feature/multi-rr'

This commit is contained in:
Quentin Dufour 2019-03-27 11:21:40 +01:00
commit 9b58098b7d
2 changed files with 8 additions and 2 deletions

View file

@ -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++;

View file

@ -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);