fengyouchao / sockslib

A Java library of SOCKS5 protocol including client and server
Apache License 2.0
284 stars 104 forks source link

Fix threading and iteration issue in StreamPipe #17

Closed bemasc closed 4 years ago

bemasc commented 6 years ago

StreamPipe's list of listeners (pipeListeners) is modified by multiple threads, and also sometimes modified by the listeners themselves. This change ensures that access to pipeListeners is fully synchronized, and mutation by the listeners cannot interfere with iteration.

Fixes https://github.com/fengyouchao/sockslib/issues/14