X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fmingw%2Fdevice.c;h=183641ba99152fc256caac622dae28425d0d4290;hb=b0ffeb7eeb21920842382c302ca15ec0d758e9b6;hp=2cce1f2bdf3faed529797b4e809ce2c86ab59801;hpb=d2b03f006f98d504e3e30f2d4b91ce02abd19c51;p=tinc diff --git a/src/mingw/device.c b/src/mingw/device.c index 2cce1f2b..183641ba 100644 --- a/src/mingw/device.c +++ b/src/mingw/device.c @@ -76,6 +76,12 @@ static void device_handle_read(void *data, int flags) { if(!GetOverlappedResult(device_handle, &device_read_overlapped, &len, FALSE)) { logger(DEBUG_ALWAYS, LOG_ERR, "Error getting read result from %s %s: %s", device_info, device, strerror(errno)); + + if(GetLastError() != ERROR_IO_INCOMPLETE) { + /* Must reset event or it will keep firing. */ + ResetEvent(device_read_overlapped.hEvent); + } + return; } @@ -206,7 +212,7 @@ static bool setup_device(void) { if(info[0] == 9 && info[1] >= 21) logger(DEBUG_ALWAYS, LOG_WARNING, "You are using the newer (>= 9.0.0.21, NDIS6) series of TAP-Win32 drivers. " - "Using these drivers with tinc is not recommanded as it can result in poor performance. " + "Using these drivers with tinc is not recommended as it can result in poor performance. " "You might want to revert back to 9.0.0.9 instead."); } }