mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-08 09:23:17 +00:00
Use unsigned long in zlib functions
This commit is contained in:
parent
c5317fe388
commit
2ee543f053
12
src/iodine.c
12
src/iodine.c
|
@ -53,13 +53,15 @@ tunnel_tun(int tun_fd, int dns_fd)
|
||||||
{
|
{
|
||||||
char out[64*1024];
|
char out[64*1024];
|
||||||
char in[64*1024];
|
char in[64*1024];
|
||||||
size_t outlen;
|
unsigned long outlen;
|
||||||
|
unsigned long inlen;
|
||||||
size_t read;
|
size_t read;
|
||||||
|
|
||||||
read = read_tun(tun_fd, in, sizeof(in));
|
read = read_tun(tun_fd, in, sizeof(in));
|
||||||
if(read > 0) {
|
if(read > 0) {
|
||||||
outlen = sizeof(out);
|
outlen = sizeof(out);
|
||||||
compress2(out, &outlen, in, read, 9);
|
inlen = read;
|
||||||
|
compress2(out, &outlen, in, inlen, 9);
|
||||||
dns_handle_tun(dns_fd, out, outlen);
|
dns_handle_tun(dns_fd, out, outlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,13 +73,15 @@ tunnel_dns(int tun_fd, int dns_fd)
|
||||||
{
|
{
|
||||||
char out[64*1024];
|
char out[64*1024];
|
||||||
char in[64*1024];
|
char in[64*1024];
|
||||||
size_t outlen;
|
unsigned long outlen;
|
||||||
|
unsigned long inlen;
|
||||||
size_t read;
|
size_t read;
|
||||||
|
|
||||||
read = dns_read(dns_fd, in, sizeof(in));
|
read = dns_read(dns_fd, in, sizeof(in));
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
outlen = sizeof(out);
|
outlen = sizeof(out);
|
||||||
uncompress(out, &outlen, in, read);
|
inlen = read;
|
||||||
|
uncompress(out, &outlen, in, inlen);
|
||||||
|
|
||||||
write_tun(tun_fd, out, outlen);
|
write_tun(tun_fd, out, outlen);
|
||||||
if (!dns_sending())
|
if (!dns_sending())
|
||||||
|
|
Loading…
Reference in a new issue