… | |
… | |
47 | #include "vpn.h" |
47 | #include "vpn.h" |
48 | |
48 | |
49 | #define MAX_POLL_INTERVAL 5. // how often to poll minimally when the server has no data |
49 | #define MAX_POLL_INTERVAL 5. // how often to poll minimally when the server has no data |
50 | #define ACTIVITY_INTERVAL 5. |
50 | #define ACTIVITY_INTERVAL 5. |
51 | |
51 | |
52 | #define TIMEOUT_FACTOR 8. |
52 | #define TIMEOUT_FACTOR 2. |
53 | |
53 | |
54 | #define INITIAL_TIMEOUT 0.1 // retry timeouts |
54 | #define INITIAL_TIMEOUT 0.1 // retry timeouts |
55 | #define INITIAL_SYN_TIMEOUT 10. // retry timeout for initial syn |
55 | #define INITIAL_SYN_TIMEOUT 10. // retry timeout for initial syn |
56 | |
56 | |
57 | #define MIN_SEND_INTERVAL 0.001 // wait at least this time between sending requests |
57 | #define MIN_SEND_INTERVAL 0.001 // wait at least this time between sending requests |
… | |
… | |
60 | #define LATENCY_FACTOR 0.5 // RTT * LATENCY_FACTOR == sending rate |
60 | #define LATENCY_FACTOR 0.5 // RTT * LATENCY_FACTOR == sending rate |
61 | #define MAX_OUTSTANDING 100 // max. outstanding requests |
61 | #define MAX_OUTSTANDING 100 // max. outstanding requests |
62 | #define MAX_WINDOW 1000 // max. for MAX_OUTSTANDING, and backlog |
62 | #define MAX_WINDOW 1000 // max. for MAX_OUTSTANDING, and backlog |
63 | #define MAX_BACKLOG (32*1024) // size of gvpe protocol backlog (bytes), must be > MAXSIZE |
63 | #define MAX_BACKLOG (32*1024) // size of gvpe protocol backlog (bytes), must be > MAXSIZE |
64 | |
64 | |
65 | #define MAX_DOMAIN_SIZE 220 // 255 is legal limit, but bind doesn't compress well |
65 | #define MAX_DOMAIN_SIZE 240 // 255 is legal limit, but bind doesn't compress well |
66 | // 240 leaves about 4 bytes of server reply data |
66 | // 240 leaves about 4 bytes of server reply data |
67 | // every request byte less give room for two reply bytes |
67 | // every request byte less give room for two reply bytes |
68 | |
68 | |
69 | #define SEQNO_MASK 0x3fff |
69 | #define SEQNO_MASK 0x3fff |
70 | #define SEQNO_EQ(a,b) ( 0 == ( ((a) ^ (b)) & SEQNO_MASK) ) |
70 | #define SEQNO_EQ(a,b) ( 0 == ( ((a) ^ (b)) & SEQNO_MASK) ) |
… | |
… | |
1229 | { |
1229 | { |
1230 | send = r; |
1230 | send = r; |
1231 | |
1231 | |
1232 | r->retry++; |
1232 | r->retry++; |
1233 | r->timeout = NOW + (r->retry * min_latency * TIMEOUT_FACTOR); |
1233 | r->timeout = NOW + (r->retry * min_latency * TIMEOUT_FACTOR); |
1234 | printf ("TO %d %f\n", r->retry, r->timeout - NOW);//D |
|
|
1235 | |
1234 | |
1236 | // the following code changes the query section a bit, forcing |
1235 | // the following code changes the query section a bit, forcing |
1237 | // the forwarder to generate a new request |
1236 | // the forwarder to generate a new request |
1238 | if (r->stdhdr) |
1237 | if (r->stdhdr) |
1239 | { |
1238 | { |