Opened 5 months ago

Closed 3 months ago

#24875 closed defect (fixed)

meek-client doesn't exit on close of stdin if there are no active handlers running

Reported by: dcf Owned by: dcf
Priority: Medium Milestone:
Component: Obfuscation/meek Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

If you give meek-client an EOF while it's not currently handling any connections, it says it is terminating but doesn't quite terminate.

$ TOR_PT_EXIT_ON_STDIN_CLOSE=1 TOR_PT_MANAGED_TRANSPORT_VER=1 TOR_PT_CLIENT_TRANSPORTS=meek ./meek-client < /dev/null
VERSION 1
CMETHOD meek socks5 127.0.0.1:35831
2018/01/11 22:03:23 listening on 127.0.0.1:35831
CMETHODS DONE
2018/01/11 22:03:23 synthesizing SIGTERM because of stdin close
2018/01/11 22:03:23 got signal terminated
2018/01/11 22:03:23 error in AcceptSocks: accept tcp 127.0.0.1:35831: use of closed network connection

It's stuck in this loop, because it only checks numHandlers == 0 inside the loop and not before entering.

	for n := range handlerChan {
		numHandlers += n
		if numHandlers == 0 {
			break
		}
	}

Child Tickets

Change History (1)

comment:1 Changed 3 months ago by dcf

Resolution: fixed
Status: newclosed

Fixed in 1a25ac4232.

Note: See TracTickets for help on using tickets.