Socks5 icon indicating copy to clipboard operation
Socks5 copied to clipboard

code is NOT thread safe in sock5.BandwidthCounter.AddByte(int)

Open gwjwin opened this issue 4 years ago • 1 comments

Problem occurs when a lot of connections request by client at the same time, you can reproduce the problem by opening 5 or more video pages in the Chrome at the same time. The variable "bytes" has chance to be modified unexpected a very large value and program go into dead while loop (cpu usage 100%).

gwjwin avatar Mar 17 '22 01:03 gwjwin

Hi @gwjwin!

Can you try to run your code on this branch? https://github.com/zacbre/Socks5/tree/connection-fix

Perhaps this will help. A long time ago I located a bug within the BandwidthCounter and made this branch to test with.

Please let me know if this fixes your problem!

Thanks!

zacbre avatar Jul 28 '22 19:07 zacbre