From 51a59bed244ec43f55c3b2acb0765583f0627867 Mon Sep 17 00:00:00 2001 From: frekky Date: Sat, 29 Aug 2015 20:07:44 +0800 Subject: [PATCH] Added more debug output and deprecated qmem --- src/user.c | 6 ++++++ src/user.h | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/user.c b/src/user.c index bf95f53..5bbe006 100644 --- a/src/user.c +++ b/src/user.c @@ -35,6 +35,7 @@ #include "encoding.h" #include "user.h" #include "window.h" +#include "server.h" struct tun_user *users; unsigned usercount; @@ -77,6 +78,11 @@ init_users(in_addr_t my_ip, int netbits) snprintf(newip, sizeof(newip), "0.0.0.%d", i + skip + 1); ip = ipstart.s_addr + inet_addr(newip); } + if (debug >= 2) { + struct in_addr IP; + IP.s_addr = ip; + fprintf(stderr, "User %d: IP %s\n", i, inet_ntoa(IP)); + } users[i].tun_ip = ip; net.s_addr = ip; /* Rest is reset on login ('V' packet) or already 0 */ diff --git a/src/user.h b/src/user.h index 637ca56..8d5e1f4 100644 --- a/src/user.h +++ b/src/user.h @@ -36,22 +36,22 @@ struct tun_user { struct sockaddr_storage host; socklen_t hostlen; struct query q; - struct query q_sendrealsoon; - int q_sendrealsoon_new; + /* TODO: multiple incoming query storage + handling */ struct frag_buffer *incoming; struct frag_buffer *outgoing; int next_upstream_ack; struct encoder *encoder; char downenc; + int downenc_bits; int fragsize; enum connection conn; int lazy; - unsigned char qmemping_cmc[QMEMPING_LEN * 4]; + /*unsigned char qmemping_cmc[QMEMPING_LEN * 4]; unsigned short qmemping_type[QMEMPING_LEN]; int qmemping_lastfilled; unsigned char qmemdata_cmc[QMEMDATA_LEN * 4]; unsigned short qmemdata_type[QMEMDATA_LEN]; - int qmemdata_lastfilled; + int qmemdata_lastfilled;*/ #ifdef DNSCACHE_LEN struct query dnscache_q[DNSCACHE_LEN]; char dnscache_answer[DNSCACHE_LEN][4096];