ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/vpn_dns.C
(Generate patch)

Comparing gvpe/src/vpn_dns.C (file contents):
Revision 1.42 by pcg, Sat Nov 10 05:14:22 2007 UTC vs.
Revision 1.50 by root, Sun Mar 6 13:49:50 2011 UTC

1/* 1/*
2 vpn_dns.C -- handle the dns tunnel part of the protocol. 2 vpn_dns.C -- handle the dns tunnel part of the protocol.
3 Copyright (C) 2003-2005 Marc Lehmann <gvpe@schmorp.de> 3 Copyright (C) 2003-2008 Marc Lehmann <gvpe@schmorp.de>
4 4
5 This file is part of GVPE. 5 This file is part of GVPE.
6 6
7 GVPE is free software; you can redistribute it and/or modify 7 GVPE is free software; you can redistribute it and/or modify it
8 it under the terms of the GNU General Public License as published by 8 under the terms of the GNU General Public License as published by the
9 the Free Software Foundation; either version 2 of the License, or 9 Free Software Foundation; either version 3 of the License, or (at your
10 (at your option) any later version. 10 option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful, but
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15 GNU General Public License for more details. 15 Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License along
18 along with gvpe; if not, write to the Free Software 18 with this program; if not, see <http://www.gnu.org/licenses/>.
19 Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19
20 Additional permission under GNU GPL version 3 section 7
21
22 If you modify this Program, or any covered work, by linking or
23 combining it with the OpenSSL project's OpenSSL library (or a modified
24 version of that library), containing parts covered by the terms of the
25 OpenSSL or SSLeay licenses, the licensors of this Program grant you
26 additional permission to convey the resulting work. Corresponding
27 Source for a non-source form of such a combination shall include the
28 source code for the parts of OpenSSL used as well as that of the
29 covered work.
20*/ 30*/
21 31
22// TODO: EDNS0 option to increase dns mtu? 32// TODO: EDNS0 option to increase dns mtu?
23// TODO: re-write dns packet parsing/creation using a safe mem-buffer 33// TODO: re-write dns packet parsing/creation using a safe mem-buffer
24// to ensure no buffer overflows or similar problems. 34// to ensure no buffer overflows or similar problems.
42#include <unistd.h> 52#include <unistd.h>
43#include <fcntl.h> 53#include <fcntl.h>
44 54
45#include <map> 55#include <map>
46 56
57#include <cstdio> /* bug in libgmp: gmp.h relies on cstdio being included */
47#include <gmp.h> 58#include <gmp.h>
48 59
49#include "netcompat.h" 60#include "netcompat.h"
50 61
51#include "vpn.h" 62#include "vpn.h"
72#define MAX_PKT_SIZE 512 83#define MAX_PKT_SIZE 512
73 84
74#define RR_TYPE_A 1 85#define RR_TYPE_A 1
75#define RR_TYPE_NULL 10 86#define RR_TYPE_NULL 10
76#define RR_TYPE_TXT 16 87#define RR_TYPE_TXT 16
88#define RR_TYPE_AAAA 28
77#define RR_TYPE_ANY 255 89#define RR_TYPE_ANY 255
78 90
79#define RR_CLASS_IN 1 91#define RR_CLASS_IN 1
80 92
81#define CMD_IP_1 207 93#define CMD_IP_1 207
105 memset (enc, (char) 0, 256); 117 memset (enc, (char) 0, 256);
106 memset (dec, (char)INVALID, 256); 118 memset (dec, (char)INVALID, 256);
107 119
108 for (size = 0; cmap [size]; size++) 120 for (size = 0; cmap [size]; size++)
109 { 121 {
122 char c = cmap [size];
123
110 enc [size] = cmap [size]; 124 enc [size] = c;
111 dec [(u8)enc [size]] = size; 125 dec [(u8)c] = size;
126
127 // allow lowercase/uppercase aliases if possible
128 if (c >= 'A' && c <= 'Z' && dec [c + ('a' - 'A')] == INVALID) dec [c + ('a' - 'A')] = size;
129 if (c >= 'a' && c <= 'z' && dec [c - ('a' - 'A')] == INVALID) dec [c - ('a' - 'A')] = size;
112 } 130 }
113 131
114 assert (size < 256); 132 assert (size < 256);
115} 133}
116 134
156 enc_len [len] = n; 174 enc_len [len] = n;
157 dec_len [n] = len; 175 dec_len [n] = len;
158 } 176 }
159} 177}
160 178
179unsigned int
161unsigned int basecoder::encode_len (unsigned int len) 180basecoder::encode_len (unsigned int len)
162{ 181{
163 return enc_len [len]; 182 return enc_len [len];
164} 183}
165 184
185unsigned int
166unsigned int basecoder::decode_len (unsigned int len) 186basecoder::decode_len (unsigned int len)
167{ 187{
168 while (len && !dec_len [len]) 188 while (len && !dec_len [len])
169 --len; 189 --len;
170 190
171 return dec_len [len]; 191 return dec_len [len];
172} 192}
173 193
194unsigned int
174unsigned int basecoder::encode (char *dst, u8 *src, unsigned int len) 195basecoder::encode (char *dst, u8 *src, unsigned int len)
175{ 196{
176 if (!len || len > MAX_DEC_LEN) 197 if (!len || len > MAX_DEC_LEN)
177 return 0; 198 return 0;
178 199
179 int elen = encode_len (len); 200 int elen = encode_len (len);
198 *dst++ = cmap.encode [dst_ [i]]; 219 *dst++ = cmap.encode [dst_ [i]];
199 220
200 return elen; 221 return elen;
201} 222}
202 223
224unsigned int
203unsigned int basecoder::decode (u8 *dst, char *src, unsigned int len) 225basecoder::decode (u8 *dst, char *src, unsigned int len)
204{ 226{
205 if (!len || len > MAX_ENC_LEN) 227 if (!len || len > MAX_ENC_LEN)
206 return 0; 228 return 0;
207 229
208 u8 src_ [MAX_ENC_LEN]; 230 u8 src_ [MAX_ENC_LEN];
267 289
268///////////////////////////////////////////////////////////////////////////// 290/////////////////////////////////////////////////////////////////////////////
269 291
270#define HDRSIZE 6 292#define HDRSIZE 6
271 293
294inline void
272inline void encode_header (char *data, int clientid, int seqno, int retry = 0) 295encode_header (char *data, int clientid, int seqno, int retry = 0)
273{ 296{
274 seqno &= SEQNO_MASK; 297 seqno &= SEQNO_MASK;
275 298
276 u8 hdr[3] = { 299 u8 hdr[3] = {
277 clientid, 300 clientid,
282 assert (clientid < 256); 305 assert (clientid < 256);
283 306
284 cdc26.encode (data, hdr, 3); 307 cdc26.encode (data, hdr, 3);
285} 308}
286 309
310inline void
287inline void decode_header (char *data, int &clientid, int &seqno) 311decode_header (char *data, int &clientid, int &seqno)
288{ 312{
289 u8 hdr[3]; 313 u8 hdr[3];
290 314
291 cdc26.decode (hdr, data, HDRSIZE); 315 cdc26.decode (hdr, data, HDRSIZE);
292 316
325byte_stream::~byte_stream () 349byte_stream::~byte_stream ()
326{ 350{
327 delete data; 351 delete data;
328} 352}
329 353
354void
330void byte_stream::remove (int count) 355byte_stream::remove (int count)
331{ 356{
332 if (count > fill) 357 if (count > fill)
333 assert (count <= fill); 358 assert (count <= fill);
334 359
335 memmove (data, data + count, fill -= count); 360 memmove (data, data + count, fill -= count);
336} 361}
337 362
363bool
338bool byte_stream::put (u8 *data, unsigned int datalen) 364byte_stream::put (u8 *data, unsigned int datalen)
339{ 365{
340 if (maxsize - fill < datalen) 366 if (maxsize - fill < datalen)
341 return false; 367 return false;
342 368
343 memcpy (this->data + fill, data, datalen); fill += datalen; 369 memcpy (this->data + fill, data, datalen); fill += datalen;
344 370
345 return true; 371 return true;
346} 372}
347 373
374bool
348bool byte_stream::put (vpn_packet *pkt) 375byte_stream::put (vpn_packet *pkt)
349{ 376{
350 if (maxsize - fill < pkt->len + 2) 377 if (maxsize - fill < pkt->len + 2)
351 return false; 378 return false;
352 379
353 data [fill++] = pkt->len >> 8; 380 data [fill++] = pkt->len >> 8;
435 bool valid (); 462 bool valid ();
436}; 463};
437 464
438int dns_cfg::next_uid; 465int dns_cfg::next_uid;
439 466
467void
440void dns_cfg::reset (int clientid) 468dns_cfg::reset (int clientid)
441{ 469{
442 id1 = 'G'; 470 id1 = 'G';
443 id2 = 'V'; 471 id2 = 'V';
444 id3 = 'P'; 472 id3 = 'P';
445 id4 = 'E'; 473 id4 = 'E';
459 487
460 r3 = r4 = 0; 488 r3 = r4 = 0;
461 r4 = r5 = r6 = r7 = 0; 489 r4 = r5 = r6 = r7 = 0;
462} 490}
463 491
492bool
464bool dns_cfg::valid () 493dns_cfg::valid ()
465{ 494{
466 // although the protocol itself allows for some configurability, 495 // although the protocol itself allows for some configurability,
467 // only the following encoding/decoding settings are implemented. 496 // only the following encoding/decoding settings are implemented.
468 return id1 == 'G' 497 return id1 == 'G'
469 && id2 == 'V' 498 && id2 == 'V'
484 u8 data [MAXSIZE - 6 * 2]; 513 u8 data [MAXSIZE - 6 * 2];
485 514
486 int decode_label (char *data, int size, int &offs); 515 int decode_label (char *data, int size, int &offs);
487}; 516};
488 517
518int
489int dns_packet::decode_label (char *data, int size, int &offs) 519dns_packet::decode_label (char *data, int size, int &offs)
490{ 520{
491 char *orig = data; 521 char *orig = data;
492 522
493 memset (data, 0, size); 523 memset (data, 0, size);
494 524
520 return data - orig; 550 return data - orig;
521} 551}
522 552
523///////////////////////////////////////////////////////////////////////////// 553/////////////////////////////////////////////////////////////////////////////
524 554
555static
556u16 next_id ()
557{
525static u16 dns_id = 0; // TODO: should be per-vpn 558 static u16 dns_id = 0; // TODO: should be per-vpn
526 559
527static u16 next_id ()
528{
529 if (!dns_id) 560 if (!dns_id)
530 dns_id = time (0); 561 dns_id = time (0);
531 562
532 // the simplest lsfr with periodicity 65535 i could find 563 // the simplest lsfr with periodicity 65535 i could find
533 dns_id = (dns_id << 1) 564 dns_id = (dns_id << 1)
559 vector<dns_rcv *> rcvpq; 590 vector<dns_rcv *> rcvpq;
560 591
561 byte_stream rcvdq; int rcvseq; int repseq; 592 byte_stream rcvdq; int rcvseq; int repseq;
562 byte_stream snddq; int sndseq; 593 byte_stream snddq; int sndseq;
563 594
564 void time_cb (ev::timer &w, int revents); ev::timer tw; 595 inline void time_cb (ev::timer &w, int revents); ev::timer tw;
565 void receive_rep (dns_rcv *r); 596 void receive_rep (dns_rcv *r);
566 597
567 dns_connection (connection *c); 598 dns_connection (connection *c);
568 ~dns_connection (); 599 ~dns_connection ();
569}; 600};
588: dns (dns) 619: dns (dns)
589{ 620{
590 timeout = 0; 621 timeout = 0;
591 retry = 0; 622 retry = 0;
592 seqno = 0; 623 seqno = 0;
593 sent = ev::ev_now (); 624 sent = ev_now ();
594 stdhdr = false; 625 stdhdr = false;
595 626
596 pkt = new dns_packet; 627 pkt = new dns_packet;
597 628
598 pkt->id = next_id (); 629 pkt->id = next_id ();
601dns_snd::~dns_snd () 632dns_snd::~dns_snd ()
602{ 633{
603 delete pkt; 634 delete pkt;
604} 635}
605 636
637static void
606static void append_domain (dns_packet &pkt, int &offs, const char *domain) 638append_domain (dns_packet &pkt, int &offs, const char *domain)
607{ 639{
608 // add tunnel domain 640 // add tunnel domain
609 for (;;) 641 for (;;)
610 { 642 {
611 const char *end = strchr (domain, '.'); 643 const char *end = strchr (domain, '.');
624 656
625 domain = end + 1; 657 domain = end + 1;
626 } 658 }
627} 659}
628 660
661void
629void dns_snd::gen_stream_req (int seqno, byte_stream &stream) 662dns_snd::gen_stream_req (int seqno, byte_stream &stream)
630{ 663{
631 stdhdr = true; 664 stdhdr = true;
632 this->seqno = seqno; 665 this->seqno = seqno;
633 666
634 timeout = ev::ev_now () + INITIAL_TIMEOUT; 667 timeout = ev_now () + INITIAL_TIMEOUT;
635 668
636 pkt->flags = htons (DEFAULT_CLIENT_FLAGS); 669 pkt->flags = htons (DEFAULT_CLIENT_FLAGS);
637 pkt->qdcount = htons (1); 670 pkt->qdcount = htons (1);
638 671
639 int offs = 6*2; 672 int offs = 6*2;
672 (*pkt)[offs++] = RR_CLASS_IN >> 8; (*pkt)[offs++] = RR_CLASS_IN; 705 (*pkt)[offs++] = RR_CLASS_IN >> 8; (*pkt)[offs++] = RR_CLASS_IN;
673 706
674 pkt->len = offs; 707 pkt->len = offs;
675} 708}
676 709
710void
677void dns_snd::gen_syn_req () 711dns_snd::gen_syn_req ()
678{ 712{
679 timeout = ev::ev_now () + INITIAL_SYN_TIMEOUT; 713 timeout = ev_now () + INITIAL_SYN_TIMEOUT;
680 714
681 pkt->flags = htons (DEFAULT_CLIENT_FLAGS); 715 pkt->flags = htons (DEFAULT_CLIENT_FLAGS);
682 pkt->qdcount = htons (1); 716 pkt->qdcount = htons (1);
683 717
684 int offs = 6 * 2; 718 int offs = 6 * 2;
724 758
725dns_connection::dns_connection (connection *c) 759dns_connection::dns_connection (connection *c)
726: c (c) 760: c (c)
727, rcvdq (MAX_BACKLOG * 2) 761, rcvdq (MAX_BACKLOG * 2)
728, snddq (MAX_BACKLOG) 762, snddq (MAX_BACKLOG)
729, tw (this, &dns_connection::time_cb)
730{ 763{
764 tw.set<dns_connection, &dns_connection::time_cb> (this);
765
731 vpn = c->vpn; 766 vpn = c->vpn;
732 767
733 established = false; 768 established = false;
734 769
735 rcvseq = repseq = sndseq = 0; 770 rcvseq = repseq = sndseq = 0;
746 i != rcvpq.end (); 781 i != rcvpq.end ();
747 ++i) 782 ++i)
748 delete *i; 783 delete *i;
749} 784}
750 785
786void
751void dns_connection::receive_rep (dns_rcv *r) 787dns_connection::receive_rep (dns_rcv *r)
752{ 788{
753 if (r->datalen) 789 if (r->datalen)
754 { 790 {
755 last_received = ev::ev_now (); 791 last_received = ev_now ();
756 tw (); 792 tw ();
757 793
758 poll_interval = send_interval; 794 poll_interval = send_interval;
759 } 795 }
760 else 796 else
789 825
790 rcvseq = (rcvseq + 1) & SEQNO_MASK; 826 rcvseq = (rcvseq + 1) & SEQNO_MASK;
791 827
792 if (!rcvdq.put (r->data, r->datalen)) 828 if (!rcvdq.put (r->data, r->datalen))
793 { 829 {
830 // MUST never overflow, can be caused by data corruption, TODO
794 slog (L_ERR, "DNS: !rcvdq.put (r->data, r->datalen)"); 831 slog (L_CRIT, "DNS: !rcvdq.put (r->data, r->datalen)");
795 abort (); // MUST never overflow, can be caused by data corruption, TODO 832 c->dnsv4_reset_connection ();
833 return;
796 } 834 }
797 835
798 while (vpn_packet *pkt = rcvdq.get ()) 836 while (vpn_packet *pkt = rcvdq.get ())
799 { 837 {
800 sockinfo si; 838 sockinfo si;
801 si.host = htonl (c->conf->id); si.port = 0; si.prot = PROT_DNSv4; 839 si.host = htonl (c->conf->id); si.port = 0; si.prot = PROT_DNSv4;
802 840
803 vpn->recv_vpn_packet (pkt, si); 841 vpn->recv_vpn_packet (pkt, si);
804
805 delete pkt; 842 delete pkt;
806 } 843 }
807 844
808 // check for further packets 845 // check for further packets
809 goto redo; 846 goto redo;
1032#if 0 1069#if 0
1033 dns->send_interval *= 0.999; 1070 dns->send_interval *= 0.999;
1034#endif 1071#endif
1035 // the latency surely puts an upper bound on 1072 // the latency surely puts an upper bound on
1036 // the minimum send interval 1073 // the minimum send interval
1037 double latency = ev::ev_now () - (*i)->sent; 1074 double latency = ev_now () - (*i)->sent;
1038 1075
1039 if (latency < dns->min_latency) 1076 if (latency < dns->min_latency)
1040 dns->min_latency = latency; 1077 dns->min_latency = latency;
1041 1078
1042 if (dns->send_interval > dns->min_latency * conf.dns_overlap_factor) 1079 if (dns->send_interval > dns->min_latency * conf.dns_overlap_factor)
1107 1144
1108 if (ip [3] == CMD_IP_RST) 1145 if (ip [3] == CMD_IP_RST)
1109 { 1146 {
1110 slog (L_DEBUG, _("DNS: got tunnel RST request")); 1147 slog (L_DEBUG, _("DNS: got tunnel RST request"));
1111 1148
1112 delete dns; c->dns = 0; 1149 c->dnsv4_reset_connection ();
1113
1114 return;
1115 } 1150 }
1116 else if (ip [3] == CMD_IP_SYN) 1151 else if (ip [3] == CMD_IP_SYN)
1117 { 1152 {
1118 slog (L_DEBUG, _("DNS: got tunnel SYN reply, server likes us.")); 1153 slog (L_DEBUG, _("DNS: got tunnel SYN reply, server likes us."));
1119 dns->established = true; 1154 dns->established = true;
1120 } 1155 }
1121 else if (ip [3] == CMD_IP_REJ) 1156 else if (ip [3] == CMD_IP_REJ)
1122 {
1123 slog (L_DEBUG, _("DNS: got tunnel REJ reply, server does not like us, aborting.")); 1157 slog (L_ERR, _("DNS: got tunnel REJ reply, server does not like us."));
1124 abort ();
1125 }
1126 else 1158 else
1127 slog (L_INFO, _("DNS: got unknown meta command %02x"), ip [3]); 1159 slog (L_INFO, _("DNS: got unknown meta command %02x"), ip [3]);
1128 } 1160 }
1129 else 1161 else
1130 slog (L_INFO, _("DNS: got spurious a record %d.%d.%d.%d"), 1162 slog (L_INFO, _("DNS: got spurious a record %d.%d.%d.%d"),
1225 i != vpn->dns_sndpq.end (); 1257 i != vpn->dns_sndpq.end ();
1226 ++i) 1258 ++i)
1227 { 1259 {
1228 dns_snd *r = *i; 1260 dns_snd *r = *i;
1229 1261
1230 if (r->timeout <= ev::ev_now ()) 1262 if (r->timeout <= ev_now ())
1231 { 1263 {
1232 if (!send) 1264 if (!send)
1233 { 1265 {
1234 send = r; 1266 send = r;
1235 1267
1236 r->retry++; 1268 r->retry++;
1237 r->timeout = ev::ev_now () + (r->retry * min_latency * conf.dns_timeout_factor); 1269 r->timeout = ev_now () + (r->retry * min_latency * conf.dns_timeout_factor);
1238 //printf ("RETRY %x (%d, %f)\n", r->seqno, r->retry, r->timeout - ev::ev_now ());//D 1270 //printf ("RETRY %x (%d, %f)\n", r->seqno, r->retry, r->timeout - ev_now ());//D
1239 1271
1240 // the following code changes the query section a bit, forcing 1272 // the following code changes the query section a bit, forcing
1241 // the forwarder to generate a new request 1273 // the forwarder to generate a new request
1242 if (r->stdhdr) 1274 if (r->stdhdr)
1243 encode_header ((char *)r->pkt->at (6 * 2 + 1), THISNODE->id, r->seqno, r->retry); 1275 encode_header ((char *)r->pkt->at (6 * 2 + 1), THISNODE->id, r->seqno, r->retry);
1262 } 1294 }
1263 } 1295 }
1264 else if (vpn->dns_sndpq.size () < conf.dns_max_outstanding 1296 else if (vpn->dns_sndpq.size () < conf.dns_max_outstanding
1265 && !SEQNO_EQ (rcvseq, sndseq - (MAX_WINDOW - 1))) 1297 && !SEQNO_EQ (rcvseq, sndseq - (MAX_WINDOW - 1)))
1266 { 1298 {
1267 if (last_sent + send_interval <= ev::ev_now ()) 1299 if (last_sent + send_interval <= ev_now ())
1268 { 1300 {
1269 //printf ("sending data request etc.\n"); //D 1301 //printf ("sending data request etc.\n"); //D
1270 if (!snddq.empty () || last_received + 1. > ev::ev_now ()) 1302 if (!snddq.empty () || last_received + 1. > ev_now ())
1271 { 1303 {
1272 poll_interval = send_interval; 1304 poll_interval = send_interval;
1273 NEXT (ev::ev_now () + send_interval); 1305 NEXT (ev_now () + send_interval);
1274 } 1306 }
1275 1307
1276 send = new dns_snd (this); 1308 send = new dns_snd (this);
1277 send->gen_stream_req (sndseq, snddq); 1309 send->gen_stream_req (sndseq, snddq);
1278 send->timeout = ev::ev_now () + min_latency * conf.dns_timeout_factor; 1310 send->timeout = ev_now () + min_latency * conf.dns_timeout_factor;
1279 //printf ("SEND %x (%f)\n", send->seqno, send->timeout - ev::ev_now (), min_latency, conf.dns_timeout_factor);//D 1311 //printf ("SEND %x (%f)\n", send->seqno, send->timeout - ev_now (), min_latency, conf.dns_timeout_factor);//D
1280 1312
1281 sndseq = (sndseq + 1) & SEQNO_MASK; 1313 sndseq = (sndseq + 1) & SEQNO_MASK;
1282 } 1314 }
1283 else 1315 else
1284 NEXT (last_sent + send_interval); 1316 NEXT (last_sent + send_interval);
1288 vpn->dns_sndpq.push_back (send); 1320 vpn->dns_sndpq.push_back (send);
1289 } 1321 }
1290 1322
1291 if (send) 1323 if (send)
1292 { 1324 {
1293 last_sent = ev::ev_now (); 1325 last_sent = ev_now ();
1294 sendto (vpn->dnsv4_fd, 1326 sendto (vpn->dnsv4_fd,
1295 send->pkt->at (0), send->pkt->len, 0, 1327 send->pkt->at (0), send->pkt->len, 0,
1296 vpn->dns_forwarder.sav4 (), vpn->dns_forwarder.salenv4 ()); 1328 vpn->dns_forwarder.sav4 (), vpn->dns_forwarder.salenv4 ());
1297 } 1329 }
1298 1330
1299 slog (L_NOISE, "DNS: pi %f si %f N %f (%d:%d %d)", 1331 slog (L_NOISE, "DNS: pi %f si %f N %f (%d:%d %d)",
1300 poll_interval, send_interval, next - ev::ev_now (), 1332 poll_interval, send_interval, next - ev_now (),
1301 vpn->dns_sndpq.size (), snddq.size (), 1333 vpn->dns_sndpq.size (), snddq.size (),
1302 rcvpq.size ()); 1334 rcvpq.size ());
1303 1335
1304 // TODO: no idea when this happens, but when next < ev::ev_now (), we have a problem 1336 // TODO: no idea when this happens, but when next < ev_now (), we have a problem
1305 // doesn't seem to happen anymore 1337 // doesn't seem to happen anymore
1306 if (next < ev::ev_now () + 0.001) 1338 if (next < ev_now () + 0.001)
1307 next = ev::ev_now () + 0.1; 1339 next = ev_now () + 0.1;
1308 1340
1309 w.start (next - ev::ev_now ()); 1341 w.start (next - ev_now ());
1310} 1342}
1311 1343
1312#endif 1344#endif
1313 1345

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines