mirror of
https://github.com/netfun2000/rttys_zhaojh329.git
synced 2026-02-27 09:53:24 +08:00
Replaced string-based keys with byte arrays for HTTP proxy in sync.Map
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
@@ -447,10 +447,13 @@ func handleFileMsg(dev *Device, data []byte) error {
|
||||
}
|
||||
|
||||
func handleHttpMsg(dev *Device, data []byte) error {
|
||||
addr := data[:18]
|
||||
var saddr [18]byte
|
||||
|
||||
copy(saddr[:], data[:18])
|
||||
|
||||
data = data[18:]
|
||||
|
||||
if c, ok := dev.https.Load(string(addr)); ok {
|
||||
if c, ok := dev.https.Load(saddr); ok {
|
||||
c := c.(net.Conn)
|
||||
if len(data) == 0 {
|
||||
c.Close()
|
||||
|
||||
Reference in New Issue
Block a user