mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Copy base client config for each SOCKS connection
Fixes a bug where socksAcceptLoop was reusing the same client config when processing arguments from multiple SOCKS connections, causing different bridge lines to clobber each other.
This commit is contained in:
parent
5f7e23813d
commit
eb13b2ff4b
1 changed files with 3 additions and 1 deletions
|
@ -60,7 +60,8 @@ func copyLoop(socks, sfconn io.ReadWriter) {
|
|||
}
|
||||
|
||||
// Accept local SOCKS connections and connect to a Snowflake connection
|
||||
func socksAcceptLoop(ln *pt.SocksListener, config sf.ClientConfig, shutdown chan struct{}, wg *sync.WaitGroup) {
|
||||
func socksAcceptLoop(ln *pt.SocksListener, baseConfig sf.ClientConfig,
|
||||
shutdown chan struct{}, wg *sync.WaitGroup) {
|
||||
defer ln.Close()
|
||||
for {
|
||||
conn, err := ln.AcceptSocks()
|
||||
|
@ -77,6 +78,7 @@ func socksAcceptLoop(ln *pt.SocksListener, config sf.ClientConfig, shutdown chan
|
|||
defer wg.Done()
|
||||
defer conn.Close()
|
||||
|
||||
config := baseConfig
|
||||
// Check to see if our command line options are overriden by SOCKS options
|
||||
if arg, ok := conn.Req.Args.Get("ampcache"); ok {
|
||||
config.AmpCacheURL = arg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue