projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f10e98f
)
In device_handle_read() we need to reset the read event on error or
author
Todd C. Miller
<Todd.Miller@sudo.ws>
Thu, 22 Feb 2018 21:27:37 +0000
(14:27 -0700)
committer
Todd C. Miller
<Todd.Miller@sudo.ws>
Thu, 22 Feb 2018 21:27:37 +0000
(14:27 -0700)
it will keep firing. This is easy to reproduce by suspending the
machine while tinc is running.
src/mingw/device.c
patch
|
blob
|
history
diff --git
a/src/mingw/device.c
b/src/mingw/device.c
index
2cce1f2
..
54e0994
100644
(file)
--- 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;
}