Probable fix for GitHub issue #63 - do not unite() if either path is TCP, since doing so can result in asymmetric failed NAT-t over UDP if one side has a firewall that permits outgoing UDP but not incoming.
This commit is contained in:
parent
119ef5ecbf
commit
b117ff5435
6 changed files with 39 additions and 19 deletions
11
main.cpp
11
main.cpp
|
@ -462,6 +462,17 @@ int main(int argc,char **argv)
|
|||
signal(SIGINT,&sighandlerQuit);
|
||||
signal(SIGTERM,&sighandlerQuit);
|
||||
signal(SIGQUIT,&sighandlerQuit);
|
||||
|
||||
/* Ensure that there are no inherited file descriptors open from a previous
|
||||
* incarnation. This is a hack to ensure that GitHub issue #61 or variants
|
||||
* of it do not return, and should not do anything otherwise bad. */
|
||||
{
|
||||
int mfd = STDIN_FILENO;
|
||||
if (STDOUT_FILENO > mfd) mfd = STDOUT_FILENO;
|
||||
if (STDERR_FILENO > mfd) mfd = STDERR_FILENO;
|
||||
for(int f=mfd+1;f<1024;++f)
|
||||
::close(f);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue