From: Laurent Mazet Date: Sun, 8 Jun 2025 21:34:46 +0000 (+0200) Subject: fix timeout in msec X-Git-Tag: v1.0~17 X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=1936f23519c3a51c365972d66f6e1fbd125bd284;p=ulvpn.git fix timeout in msec --- diff --git a/mapec.c b/mapec.c index be3f62e..1cb8754 100644 --- a/mapec.c +++ b/mapec.c @@ -410,11 +410,12 @@ int MAPEC_Receive_timeout (int fid, unsigned char *buffer, int maxlen, int ms) VERBOSE (mapec, TRACE, PRINTF ("MAPEC_Receive_timeout\n")); fd_set rfds; - struct timeval tv = { 0, ms }; + struct timeval tv = { 0, ms * 1000 }; FD_ZERO (&rfds); FD_SET (fid, &rfds); int retval = select (fid + 1, &rfds, NULL, NULL, &tv); + VERBOSE (mapec, TRACE, PRINTF ("select: %d (%ld, %ld)\n", retval, tv.tv_sec, tv.tv_usec)); if (retval != 1) { return retval; }