… | |
… | |
52 | |
52 | |
53 | #define INITIAL_TIMEOUT 0.1 // retry timeouts |
53 | #define INITIAL_TIMEOUT 0.1 // retry timeouts |
54 | #define INITIAL_SYN_TIMEOUT 10. // retry timeout for initial syn |
54 | #define INITIAL_SYN_TIMEOUT 10. // retry timeout for initial syn |
55 | |
55 | |
56 | #define MIN_SEND_INTERVAL 0.01 // wait at least this time between sending requests |
56 | #define MIN_SEND_INTERVAL 0.01 // wait at least this time between sending requests |
57 | #define MAX_SEND_INTERVAL 0.5 // optimistic? |
57 | #define MAX_SEND_INTERVAL 2. // optimistic? |
58 | |
58 | |
|
|
59 | #define LATENCY_FACTOR 0.5 // RTT * LATENCY_FACTOR == sending rate |
59 | #define MAX_OUTSTANDING 10 // max. outstanding requests |
60 | #define MAX_OUTSTANDING 100 // max. outstanding requests |
60 | #define MAX_WINDOW 1000 // max. for MAX_OUTSTANDING, and backlog |
61 | #define MAX_WINDOW 1000 // max. for MAX_OUTSTANDING, and backlog |
61 | #define MAX_BACKLOG (100*1024) // size of gvpe protocol backlog (bytes), must be > MAXSIZE |
62 | #define MAX_BACKLOG (100*1024) // size of gvpe protocol backlog (bytes), must be > MAXSIZE |
62 | |
63 | |
63 | #define MAX_DOMAIN_SIZE 220 // 255 is legal limit, but bind doesn't compress well |
64 | #define MAX_DOMAIN_SIZE 240 // 255 is legal limit, but bind doesn't compress well |
64 | // 240 leaves about 4 bytes of server reply data |
65 | // 240 leaves about 4 bytes of server reply data |
65 | // every two request bytes less give room for one reply byte |
66 | // every two request bytes less give room for one reply byte |
66 | |
67 | |
67 | #define SEQNO_MASK 0x3fff |
68 | #define SEQNO_MASK 0x3fff |
68 | #define SEQNO_EQ(a,b) ( 0 == ( ((a) ^ (b)) & SEQNO_MASK) ) |
69 | #define SEQNO_EQ(a,b) ( 0 == ( ((a) ^ (b)) & SEQNO_MASK) ) |
… | |
… | |
265 | static basecoder cdc26 ("dPhZrQmJkBtSvLxAeFwGyO"); |
266 | static basecoder cdc26 ("dPhZrQmJkBtSvLxAeFwGyO"); |
266 | |
267 | |
267 | ///////////////////////////////////////////////////////////////////////////// |
268 | ///////////////////////////////////////////////////////////////////////////// |
268 | |
269 | |
269 | #define HDRSIZE 6 |
270 | #define HDRSIZE 6 |
270 | |
271 | |
271 | inline void encode_header (char *data, int clientid, int seqno, int retry = 0) |
272 | inline void encode_header (char *data, int clientid, int seqno, int retry = 0) |
272 | { |
273 | { |
273 | seqno &= SEQNO_MASK; |
274 | seqno &= SEQNO_MASK; |
274 | |
275 | |
275 | u8 hdr[3] = { |
276 | u8 hdr[3] = { |
… | |
… | |
409 | struct dns_cfg |
410 | struct dns_cfg |
410 | { |
411 | { |
411 | static int next_uid; |
412 | static int next_uid; |
412 | |
413 | |
413 | u8 id1, id2, id3, id4; |
414 | u8 id1, id2, id3, id4; |
|
|
415 | |
414 | u8 version; |
416 | u8 version; |
|
|
417 | u8 flags; |
415 | u8 rrtype; |
418 | u8 rrtype; |
416 | u8 flags; |
|
|
417 | u8 def_ttl; |
419 | u8 def_ttl; |
418 | u8 rcv_cdc; |
420 | |
419 | u8 snd_cdc; |
|
|
420 | u16 max_size; |
|
|
421 | u16 client; |
421 | u16 client; |
422 | u16 uid; // to make request unique |
422 | u16 uid; // to make request unique |
423 | |
423 | |
424 | u8 reserved[8]; |
424 | u16 max_size; |
|
|
425 | u8 seq_cdc; |
|
|
426 | u8 req_cdc; |
|
|
427 | |
|
|
428 | u8 rep_cdc; |
|
|
429 | u8 r2, r3, r4; |
|
|
430 | |
|
|
431 | u8 r5, r6, r7, r8; |
425 | |
432 | |
426 | void reset (int clientid); |
433 | void reset (int clientid); |
427 | bool valid (); |
434 | bool valid (); |
428 | }; |
435 | }; |
429 | |
436 | |
… | |
… | |
438 | |
445 | |
439 | version = 1; |
446 | version = 1; |
440 | |
447 | |
441 | rrtype = RR_TYPE_TXT; |
448 | rrtype = RR_TYPE_TXT; |
442 | flags = 0; |
449 | flags = 0; |
443 | def_ttl = 1; |
450 | def_ttl = 0; |
|
|
451 | seq_cdc = 26; |
|
|
452 | req_cdc = 62; |
444 | rcv_cdc = 0; |
453 | rep_cdc = 0; |
445 | snd_cdc = 62; |
|
|
446 | max_size = ntohs (MAX_PKT_SIZE); |
454 | max_size = htons (MAX_PKT_SIZE); |
447 | client = ntohs (clientid); |
455 | client = htons (clientid); |
448 | uid = next_uid++; |
456 | uid = next_uid++; |
449 | |
457 | |
450 | memset (reserved, 0, 8); |
458 | r2 = r3 = r4 = 0; |
|
|
459 | r4 = r5 = r6 = r7 = 0; |
451 | } |
460 | } |
452 | |
461 | |
453 | bool dns_cfg::valid () |
462 | bool dns_cfg::valid () |
454 | { |
463 | { |
455 | return id1 == 'G' |
464 | return id1 == 'G' |
456 | && id2 == 'V' |
465 | && id2 == 'V' |
457 | && id3 == 'P' |
466 | && id3 == 'P' |
458 | && id4 == 'E' |
467 | && id4 == 'E' |
|
|
468 | && seq_cdc == 26 |
|
|
469 | && req_cdc == 62 |
|
|
470 | && rep_cdc == 0 |
459 | && version == 1 |
471 | && version == 1; |
460 | && flags == 0 |
|
|
461 | && rcv_cdc == 0 |
|
|
462 | && snd_cdc == 62 |
|
|
463 | && max_size == ntohs (MAX_PKT_SIZE); |
|
|
464 | } |
472 | } |
465 | |
473 | |
466 | struct dns_packet : net_packet |
474 | struct dns_packet : net_packet |
467 | { |
475 | { |
468 | u16 id; |
476 | u16 id; |
469 | u16 flags; // QR:1 Opcode:4 AA:1 TC:1 RD:1 RA:1 Z:3 RCODE:4 |
477 | u16 flags; // QR:1 Opcode:4 AA:1 TC:1 RD:1 RA:1 Z:3 RCODE:4 |
470 | u16 qdcount, ancount, nscount, arcount; |
478 | u16 qdcount, ancount, nscount, arcount; |
471 | |
479 | |
472 | u8 data[MAXSIZE - 6 * 2]; |
480 | u8 data [MAXSIZE - 6 * 2]; |
473 | |
481 | |
474 | int decode_label (char *data, int size, int &offs); |
482 | int decode_label (char *data, int size, int &offs); |
475 | }; |
483 | }; |
476 | |
484 | |
477 | int dns_packet::decode_label (char *data, int size, int &offs) |
485 | int dns_packet::decode_label (char *data, int size, int &offs) |
… | |
… | |
539 | |
547 | |
540 | bool established; |
548 | bool established; |
541 | |
549 | |
542 | tstamp last_received; |
550 | tstamp last_received; |
543 | tstamp last_sent; |
551 | tstamp last_sent; |
544 | double last_latency; |
552 | double min_latency; |
545 | double poll_interval, send_interval; |
553 | double poll_interval, send_interval; |
546 | |
554 | |
547 | vector<dns_rcv *> rcvpq; |
555 | vector<dns_rcv *> rcvpq; |
548 | |
556 | |
549 | byte_stream rcvdq; int rcvseq; |
557 | byte_stream rcvdq; int rcvseq; |
… | |
… | |
663 | } |
671 | } |
664 | |
672 | |
665 | void dns_snd::gen_syn_req () |
673 | void dns_snd::gen_syn_req () |
666 | { |
674 | { |
667 | timeout = NOW + INITIAL_SYN_TIMEOUT; |
675 | timeout = NOW + INITIAL_SYN_TIMEOUT; |
668 | |
|
|
669 | printf ("send syn\n");//D |
|
|
670 | |
676 | |
671 | pkt->flags = htons (DEFAULT_CLIENT_FLAGS); |
677 | pkt->flags = htons (DEFAULT_CLIENT_FLAGS); |
672 | pkt->qdcount = htons (1); |
678 | pkt->qdcount = htons (1); |
673 | |
679 | |
674 | int offs = 6 * 2; |
680 | int offs = 6 * 2; |
… | |
… | |
725 | rcvseq = sndseq = 0; |
731 | rcvseq = sndseq = 0; |
726 | |
732 | |
727 | last_sent = last_received = 0; |
733 | last_sent = last_received = 0; |
728 | poll_interval = MIN_POLL_INTERVAL; |
734 | poll_interval = MIN_POLL_INTERVAL; |
729 | send_interval = 0.5; // starting rate |
735 | send_interval = 0.5; // starting rate |
730 | last_latency = INITIAL_TIMEOUT; |
736 | min_latency = INITIAL_TIMEOUT; |
731 | } |
737 | } |
732 | |
738 | |
733 | dns_connection::~dns_connection () |
739 | dns_connection::~dns_connection () |
734 | { |
740 | { |
735 | for (vector<dns_rcv *>::iterator i = rcvpq.begin (); |
741 | for (vector<dns_rcv *>::iterator i = rcvpq.begin (); |
… | |
… | |
748 | poll_interval = send_interval; |
754 | poll_interval = send_interval; |
749 | } |
755 | } |
750 | else |
756 | else |
751 | { |
757 | { |
752 | poll_interval *= 1.5; |
758 | poll_interval *= 1.5; |
|
|
759 | |
753 | if (poll_interval > MAX_POLL_INTERVAL) |
760 | if (poll_interval > MAX_POLL_INTERVAL) |
754 | poll_interval = MAX_POLL_INTERVAL; |
761 | poll_interval = MAX_POLL_INTERVAL; |
755 | } |
762 | } |
756 | |
763 | |
757 | rcvpq.push_back (r); |
764 | rcvpq.push_back (r); |
… | |
… | |
807 | pkt.flags = htons (DEFAULT_SERVER_FLAGS | FLAG_RCODE_FORMERR); |
814 | pkt.flags = htons (DEFAULT_SERVER_FLAGS | FLAG_RCODE_FORMERR); |
808 | |
815 | |
809 | if (0 == (flags & (FLAG_RESPONSE | FLAG_OP_MASK)) |
816 | if (0 == (flags & (FLAG_RESPONSE | FLAG_OP_MASK)) |
810 | && pkt.qdcount == htons (1)) |
817 | && pkt.qdcount == htons (1)) |
811 | { |
818 | { |
812 | char qname[MAXSIZE]; |
819 | char qname [MAXSIZE]; |
813 | int qlen = pkt.decode_label ((char *)qname, MAXSIZE - offs, offs); |
820 | int qlen = pkt.decode_label ((char *)qname, MAXSIZE - offs, offs); |
814 | |
821 | |
815 | u16 qtype = pkt [offs++] << 8; qtype |= pkt [offs++]; |
822 | u16 qtype = pkt [offs++] << 8; qtype |= pkt [offs++]; |
816 | u16 qclass = pkt [offs++] << 8; qclass |= pkt [offs++]; |
823 | u16 qclass = pkt [offs++] << 8; qclass |= pkt [offs++]; |
817 | |
824 | |
… | |
… | |
824 | |
831 | |
825 | int dlen = strlen (THISNODE->domain); |
832 | int dlen = strlen (THISNODE->domain); |
826 | |
833 | |
827 | if (qclass == RR_CLASS_IN |
834 | if (qclass == RR_CLASS_IN |
828 | && qlen > dlen + 1 |
835 | && qlen > dlen + 1 |
829 | && !memcmp (qname + qlen - dlen - 1, THISNODE->domain, dlen)) |
836 | && !memcmp (qname + qlen - (dlen + 1), THISNODE->domain, dlen)) |
830 | { |
837 | { |
831 | // now generate reply |
838 | // now generate reply |
832 | pkt.ancount = htons (1); // one answer RR |
839 | pkt.ancount = htons (1); // one answer RR |
833 | pkt.flags = htons (DEFAULT_SERVER_FLAGS | FLAG_RCODE_OK); |
840 | pkt.flags = htons (DEFAULT_SERVER_FLAGS | FLAG_RCODE_OK); |
834 | |
841 | |
… | |
… | |
886 | pkt [offs++] = 0; pkt [offs++] = 0; |
893 | pkt [offs++] = 0; pkt [offs++] = 0; |
887 | pkt [offs++] = 0; pkt [offs++] = dns ? dns->cfg.def_ttl : 0; // TTL |
894 | pkt [offs++] = 0; pkt [offs++] = dns ? dns->cfg.def_ttl : 0; // TTL |
888 | |
895 | |
889 | int rdlen_offs = offs += 2; |
896 | int rdlen_offs = offs += 2; |
890 | |
897 | |
891 | int dlen = (dns ? ntohs (dns->cfg.max_size) : MAX_PKT_SIZE) - offs; |
|
|
892 | // bind doesn't compress well, so reduce further by one label length |
|
|
893 | dlen -= qlen; |
|
|
894 | |
|
|
895 | if (dns) |
898 | if (dns) |
896 | { |
899 | { |
|
|
900 | int dlen = ntohs (dns->cfg.max_size) - offs; |
|
|
901 | |
|
|
902 | // bind doesn't compress well, so reduce further by one label length |
|
|
903 | dlen -= qlen; |
|
|
904 | |
897 | // only put data into in-order sequence packets, if |
905 | // only put data into in-order sequence packets, if |
898 | // we receive out-of-order packets we generate empty |
906 | // we receive out-of-order packets we generate empty |
899 | // replies |
907 | // replies |
900 | while (dlen > 1 && !dns->snddq.empty () && in_seq) |
908 | while (dlen > 1 && !dns->snddq.empty () && in_seq) |
901 | { |
909 | { |
… | |
… | |
956 | pkt [offs++] = RR_CLASS_IN >> 8; pkt [offs++] = RR_CLASS_IN; // class |
964 | pkt [offs++] = RR_CLASS_IN >> 8; pkt [offs++] = RR_CLASS_IN; // class |
957 | pkt [offs++] = 0; pkt [offs++] = 0; |
965 | pkt [offs++] = 0; pkt [offs++] = 0; |
958 | pkt [offs++] = 0; pkt [offs++] = cfg.def_ttl; // TTL |
966 | pkt [offs++] = 0; pkt [offs++] = cfg.def_ttl; // TTL |
959 | pkt [offs++] = 0; pkt [offs++] = 4; // rdlength |
967 | pkt [offs++] = 0; pkt [offs++] = 4; // rdlength |
960 | |
968 | |
961 | slog (L_INFO, _("DNS: client %d tries to connect"), client); |
969 | slog (L_INFO, _("DNS: client %d connects"), client); |
962 | |
970 | |
963 | pkt [offs++] = CMD_IP_1; pkt [offs++] = CMD_IP_2; pkt [offs++] = CMD_IP_3; |
971 | pkt [offs++] = CMD_IP_1; pkt [offs++] = CMD_IP_2; pkt [offs++] = CMD_IP_3; |
964 | pkt [offs++] = CMD_IP_REJ; |
972 | pkt [offs++] = CMD_IP_REJ; |
965 | |
973 | |
966 | if (0 < client && client <= conns.size ()) |
974 | if (0 < client && client <= conns.size ()) |
… | |
… | |
1009 | if (dns->send_interval > MAX_SEND_INTERVAL) |
1017 | if (dns->send_interval > MAX_SEND_INTERVAL) |
1010 | dns->send_interval = MAX_SEND_INTERVAL; |
1018 | dns->send_interval = MAX_SEND_INTERVAL; |
1011 | } |
1019 | } |
1012 | else |
1020 | else |
1013 | { |
1021 | { |
1014 | #if 1 |
1022 | #if 0 |
1015 | dns->send_interval *= 0.999; |
1023 | dns->send_interval *= 0.999; |
1016 | #endif |
1024 | #endif |
1017 | if (dns->send_interval < MIN_SEND_INTERVAL) |
|
|
1018 | dns->send_interval = MIN_SEND_INTERVAL; |
|
|
1019 | |
|
|
1020 | // the latency surely puts an upper bound on |
1025 | // the latency surely puts an upper bound on |
1021 | // the minimum send interval |
1026 | // the minimum send interval |
1022 | double latency = NOW - (*i)->sent; |
1027 | double latency = NOW - (*i)->sent; |
|
|
1028 | |
|
|
1029 | if (latency < dns->min_latency) |
1023 | dns->last_latency = latency; |
1030 | dns->min_latency = latency; |
1024 | |
1031 | |
1025 | if (dns->send_interval > latency) |
1032 | if (dns->send_interval > dns->min_latency * LATENCY_FACTOR) |
1026 | dns->send_interval = latency; |
1033 | dns->send_interval = dns->min_latency * LATENCY_FACTOR; |
|
|
1034 | |
|
|
1035 | if (dns->send_interval < MIN_SEND_INTERVAL) |
|
|
1036 | dns->send_interval = MIN_SEND_INTERVAL; |
1027 | } |
1037 | } |
1028 | |
1038 | |
1029 | delete *i; |
1039 | delete *i; |
1030 | dns_sndpq.erase (i); |
1040 | dns_sndpq.erase (i); |
1031 | |
1041 | |
… | |
… | |
1148 | |
1158 | |
1149 | pkt->len = recvfrom (w.fd, pkt->at (0), MAXSIZE, 0, (sockaddr *)&sa, &sa_len); |
1159 | pkt->len = recvfrom (w.fd, pkt->at (0), MAXSIZE, 0, (sockaddr *)&sa, &sa_len); |
1150 | |
1160 | |
1151 | if (pkt->len > 0) |
1161 | if (pkt->len > 0) |
1152 | { |
1162 | { |
1153 | if (THISNODE->dns_port) |
1163 | if (ntohs (pkt->flags) & FLAG_RESPONSE) |
|
|
1164 | dnsv4_client (*pkt); |
|
|
1165 | else |
1154 | { |
1166 | { |
1155 | dnsv4_server (*pkt); |
1167 | dnsv4_server (*pkt); |
1156 | sendto (w.fd, pkt->at (0), pkt->len, 0, (sockaddr *)&sa, sa_len); |
1168 | sendto (w.fd, pkt->at (0), pkt->len, 0, (sockaddr *)&sa, sa_len); |
1157 | } |
1169 | } |
1158 | else |
|
|
1159 | dnsv4_client (*pkt); |
|
|
1160 | |
1170 | |
1161 | delete pkt; |
1171 | delete pkt; |
1162 | } |
1172 | } |
1163 | } |
1173 | } |
1164 | } |
1174 | } |
… | |
… | |
1213 | if (!send) |
1223 | if (!send) |
1214 | { |
1224 | { |
1215 | send = r; |
1225 | send = r; |
1216 | |
1226 | |
1217 | r->retry++; |
1227 | r->retry++; |
1218 | r->timeout = NOW + (r->retry * last_latency * 8.); |
1228 | r->timeout = NOW + (r->retry * min_latency * 8.); |
1219 | |
1229 | |
1220 | // the following code changes the query section a bit, forcing |
1230 | // the following code changes the query section a bit, forcing |
1221 | // the forwarder to generate a new request |
1231 | // the forwarder to generate a new request |
1222 | if (r->stdhdr) |
1232 | if (r->stdhdr) |
1223 | { |
1233 | { |
1224 | //printf ("reencoded header for ID %d retry %d:%d:%d\n", htons (r->pkt->id), THISNODE->id, r->seqno, r->retry);printf ("reencoded header for ID %d retry %d:%d:%d\n", htons (r->pkt->id), THISNODE->id, r->seqno, r->retry); |
1234 | //printf ("reencoded header for ID %d retry %d:%d:%d (%p)\n", htons (r->pkt->id), THISNODE->id, r->seqno, r->retry); |
1225 | //encode_header ((char *)r->pkt->at (6 * 2 + 1), THISNODE->id, r->seqno, r->retry); |
1235 | //encode_header ((char *)r->pkt->at (6 * 2 + 1), THISNODE->id, r->seqno, r->retry); |
1226 | } |
1236 | } |
1227 | } |
1237 | } |
1228 | } |
1238 | } |
1229 | else |
1239 | else |
1230 | NEXT (r->timeout); |
1240 | NEXT (r->timeout); |
1231 | } |
1241 | } |
1232 | |
1242 | |
1233 | if (last_sent + send_interval <= NOW) |
|
|
1234 | { |
|
|
1235 | if (!send) |
1243 | if (!send) |
|
|
1244 | { |
|
|
1245 | // generate a new packet, if wise |
|
|
1246 | |
|
|
1247 | if (!established) |
1236 | { |
1248 | { |
1237 | // generate a new packet, if wise |
1249 | if (vpn->dns_sndpq.empty ()) |
1238 | |
|
|
1239 | if (!established) |
|
|
1240 | { |
1250 | { |
1241 | if (vpn->dns_sndpq.empty ()) |
|
|
1242 | { |
|
|
1243 | send = new dns_snd (this); |
1251 | send = new dns_snd (this); |
1244 | |
1252 | |
1245 | printf ("new conn %p %d\n", this, c->conf->id);//D |
|
|
1246 | cfg.reset (THISNODE->id); |
1253 | cfg.reset (THISNODE->id); |
1247 | send->gen_syn_req (); |
1254 | send->gen_syn_req (); |
1248 | } |
|
|
1249 | } |
1255 | } |
|
|
1256 | } |
1250 | else if (vpn->dns_sndpq.size () < MAX_OUTSTANDING |
1257 | else if (vpn->dns_sndpq.size () < MAX_OUTSTANDING |
1251 | && !SEQNO_EQ (rcvseq, sndseq - (MAX_WINDOW - 1))) |
1258 | && !SEQNO_EQ (rcvseq, sndseq - (MAX_WINDOW - 1))) |
|
|
1259 | { |
|
|
1260 | if (last_sent + send_interval <= NOW) |
1252 | { |
1261 | { |
1253 | //printf ("sending data request etc.\n"); //D |
1262 | //printf ("sending data request etc.\n"); //D |
1254 | if (!snddq.empty ()) |
1263 | if (!snddq.empty () || last_received + 1. > NOW) |
1255 | { |
1264 | { |
1256 | poll_interval = send_interval; |
1265 | poll_interval = send_interval; |
1257 | NEXT (NOW + send_interval); |
1266 | NEXT (NOW + send_interval); |
1258 | } |
1267 | } |
1259 | |
1268 | |
1260 | send = new dns_snd (this); |
1269 | send = new dns_snd (this); |
1261 | send->gen_stream_req (sndseq, snddq); |
1270 | send->gen_stream_req (sndseq, snddq); |
1262 | send->timeout = NOW + last_latency * 8.; |
1271 | send->timeout = NOW + min_latency * 8.; |
1263 | |
1272 | |
1264 | sndseq = (sndseq + 1) & SEQNO_MASK; |
1273 | sndseq = (sndseq + 1) & SEQNO_MASK; |
1265 | } |
1274 | } |
1266 | |
1275 | else |
1267 | if (send) |
1276 | NEXT (last_sent + send_interval); |
1268 | vpn->dns_sndpq.push_back (send); |
|
|
1269 | } |
1277 | } |
1270 | |
1278 | |
1271 | if (send) |
1279 | if (send) |
1272 | { |
1280 | vpn->dns_sndpq.push_back (send); |
|
|
1281 | } |
|
|
1282 | |
|
|
1283 | if (send) |
|
|
1284 | { |
1273 | last_sent = NOW; |
1285 | last_sent = NOW; |
1274 | sendto (vpn->dnsv4_fd, |
1286 | sendto (vpn->dnsv4_fd, |
1275 | send->pkt->at (0), send->pkt->len, 0, |
1287 | send->pkt->at (0), send->pkt->len, 0, |
1276 | vpn->dns_forwarder.sav4 (), vpn->dns_forwarder.salenv4 ()); |
1288 | vpn->dns_forwarder.sav4 (), vpn->dns_forwarder.salenv4 ()); |
1277 | } |
|
|
1278 | } |
1289 | } |
1279 | else |
|
|
1280 | NEXT (last_sent + send_interval); |
|
|
1281 | |
1290 | |
1282 | slog (L_NOISE, "DNS: pi %f si %f N %f (%d:%d)", |
1291 | slog (L_NOISE, "DNS: pi %f si %f N %f (%d:%d %d)", |
1283 | poll_interval, send_interval, next - NOW, |
1292 | poll_interval, send_interval, next - NOW, |
1284 | vpn->dns_sndpq.size (), snddq.size ()); |
1293 | vpn->dns_sndpq.size (), snddq.size (), |
|
|
1294 | rcvpq.size ()); |
1285 | |
1295 | |
1286 | // TODO: no idea when this happens, but when next < NOW, we have a problem |
1296 | // TODO: no idea when this happens, but when next < NOW, we have a problem |
1287 | if (next < NOW + 0.0001) |
1297 | if (next < NOW + 0.001) |
1288 | next = NOW + 0.1; |
1298 | next = NOW + 0.1; |
1289 | |
1299 | |
1290 | w.start (next); |
1300 | w.start (next); |
1291 | } |
1301 | } |
1292 | |
1302 | |