From d4e077aff40873462d91ea1b518196c0d0993365 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Mon, 5 Jan 2009 18:50:46 +0000 Subject: [PATCH] downstream fragsize is now per user --- src/iodined.c | 3 +-- src/user.c | 1 + src/user.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/iodined.c b/src/iodined.c index 10c1a33..c0076fe 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -164,8 +164,7 @@ send_chunk(int dns_fd, int userid) { int datalen; int last; - /* TODO change this 1200b value to dynamic */ - datalen = MIN(1200, users[userid].outpacket.len - users[userid].outpacket.offset); + datalen = MIN(users[userid].fragsize, users[userid].outpacket.len - users[userid].outpacket.offset); if (datalen && users[userid].outpacket.sentlen > 0 && ( diff --git a/src/user.c b/src/user.c index 26d49b8..01b4021 100644 --- a/src/user.c +++ b/src/user.c @@ -84,6 +84,7 @@ init_users(in_addr_t my_ip, int netbits) users[i].q.id = 0; users[i].out_acked_seqno = 0; users[i].out_acked_fragment = 0; + users[i].fragsize = 4096; } return created_users; diff --git a/src/user.h b/src/user.h index caee959..51fdfbc 100644 --- a/src/user.h +++ b/src/user.h @@ -33,6 +33,7 @@ struct user { struct encoder *encoder; int out_acked_seqno; int out_acked_fragment; + int fragsize; }; extern struct user users[USERS];