projects
/
oweals
/
tinc.git
/ 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 2cce1f2bdf3faed529797b4e809ce2c86ab59801..54e09942ce70e07df62a7e37a0ef6d535445743a 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;
}