mirror of
https://github.com/yarrick/iodine.git
synced 2024-12-26 01:27:47 +00:00
use packet functions for empty check and fill
This commit is contained in:
parent
c8726f2c5d
commit
317e1efbd6
@ -82,10 +82,8 @@ tunnel_tun(int tun_fd, int dns_fd)
|
|||||||
compress2((uint8_t*)out, &outlen, (uint8_t*)in, read, 9);
|
compress2((uint8_t*)out, &outlen, (uint8_t*)in, read, 9);
|
||||||
|
|
||||||
/* if another packet is queued, throw away this one. TODO build queue */
|
/* if another packet is queued, throw away this one. TODO build queue */
|
||||||
if (users[userid].outpacket.len == 0) {
|
if (packet_empty(&(users[userid].outpacket))) {
|
||||||
memcpy(users[userid].outpacket.data, out, outlen);
|
return packet_fill(&(users[userid].outpacket), out, outlen);
|
||||||
users[userid].outpacket.len = outlen;
|
|
||||||
return outlen;
|
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user