downstream fragsize is now per user

This commit is contained in:
Erik Ekman 2009-01-05 18:50:46 +00:00 committed by Erik Ekman
parent d2b019a6df
commit d4e077aff4
3 changed files with 3 additions and 2 deletions

View File

@ -164,8 +164,7 @@ send_chunk(int dns_fd, int userid) {
int datalen; int datalen;
int last; int last;
/* TODO change this 1200b value to dynamic */ datalen = MIN(users[userid].fragsize, users[userid].outpacket.len - users[userid].outpacket.offset);
datalen = MIN(1200, users[userid].outpacket.len - users[userid].outpacket.offset);
if (datalen && users[userid].outpacket.sentlen > 0 && if (datalen && users[userid].outpacket.sentlen > 0 &&
( (

View File

@ -84,6 +84,7 @@ init_users(in_addr_t my_ip, int netbits)
users[i].q.id = 0; users[i].q.id = 0;
users[i].out_acked_seqno = 0; users[i].out_acked_seqno = 0;
users[i].out_acked_fragment = 0; users[i].out_acked_fragment = 0;
users[i].fragsize = 4096;
} }
return created_users; return created_users;

View File

@ -33,6 +33,7 @@ struct user {
struct encoder *encoder; struct encoder *encoder;
int out_acked_seqno; int out_acked_seqno;
int out_acked_fragment; int out_acked_fragment;
int fragsize;
}; };
extern struct user users[USERS]; extern struct user users[USERS];