mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-25 11:05:15 +00:00
Added user ping flag, all_users_waiting_to_send now makes sense
This commit is contained in:
parent
faf7d277a8
commit
9ee23992c0
10
src/user.c
10
src/user.c
@ -128,14 +128,14 @@ user_active(int i)
|
||||
int
|
||||
all_users_waiting_to_send()
|
||||
/* If this returns true, then reading from tun device is blocked.
|
||||
So only return true when all clients have at least one fragment in
|
||||
the outgoing buffer, so that sending back-to-back is possible
|
||||
without going through another select loop.
|
||||
*/
|
||||
So only return true when all clients have insufficient space in
|
||||
outgoing buffer, so that sending back-to-back is possible
|
||||
without going through another select loop. */
|
||||
{
|
||||
for (int i = 0; i < usercount; i++)
|
||||
if (user_active(i))
|
||||
if (!user_sending(i)) return 0;
|
||||
if (users[i].outgoing->length - users[i].outgoing->numitems > 8)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ struct tun_user {
|
||||
struct frag_buffer *incoming;
|
||||
struct frag_buffer *outgoing;
|
||||
int next_upstream_ack;
|
||||
int send_ping_next;
|
||||
struct encoder *encoder;
|
||||
char downenc;
|
||||
int downenc_bits;
|
||||
|
Loading…
Reference in New Issue
Block a user