n2n icon indicating copy to clipboard operation
n2n copied to clipboard

2.9 windows version ,parent process send SIGINT to child edge process not work,but it works on linux

Open introspection3 opened this issue 3 years ago • 9 comments

2.9 windows version ,parent process send SIGINT to child edge process not work,but it works on linux, linux can receive the message : ok, I am leaving now

but windows can not

introspection3 avatar Sep 23 '21 02:09 introspection3

Windows has always been weak.

lucktu avatar Sep 23 '21 03:09 lucktu

@lucktu @Logan007 you can tell me which function should be called when ctrl+c on windows,I will do it

introspection3 avatar Sep 23 '21 06:09 introspection3

image @Logan007

introspection3 avatar Sep 23 '21 06:09 introspection3

I have observed the extra thread (Windows only!) not immediately reacting, i.e. it took some seconds to terminate the edge after CTRL + C, but so far, I have never went deeper into it.

I guess we need to investigate the tun_read_thread in more detail.

but it works on linux

There is no need for a chhild process / thread in Linux as TAP handling works differently.

Logan007 avatar Sep 23 '21 08:09 Logan007

I think you can call send_unregister_super first when ctrl+c

introspection3 avatar Sep 23 '21 09:09 introspection3

I think you can call send_unregister_super first when ctrl+c

:+1: Will change it.

This however probably does not solve the blocking WaitForSingleObject. I went a bit into it suspecting the IO to be blocking, but realized thatwin32/wintap.c opens it with FILE_FLAG_OVERLAPPED... so, I am a bit puzzled here.

Logan007 avatar Sep 23 '21 10:09 Logan007

I found that it may be blocked in while loop

introspection3 avatar Sep 23 '21 10:09 introspection3

i have pulled request,please check it ,you can make the code better

introspection3 avatar Sep 23 '21 10:09 introspection3

Thank you, I will have a look.

Logan007 avatar Sep 23 '21 10:09 Logan007