Skip to content

Commit

Permalink
hehe
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Feb 1, 2025
1 parent 91cbe4b commit d885a1c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions handlers/scraper/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ func InitRemoteScraper(listenAddr *net.TCPAddr, authCode []byte) error {
continue
}

// deadline for read 5s
conn.SetReadDeadline(time.Now().Add(5 * time.Second))

authBytes := make([]byte, 8)
n, err := conn.Read(authBytes)
if err != nil || !bytes.Equal(authBytes[:n], authCode) {
conn.Close()
continue
}
conn.Write([]byte("ok"))
conn.SetReadDeadline(time.Time{})

go handleConnection(conn)
}
}(ln, authCode)
Expand Down Expand Up @@ -106,7 +94,7 @@ func handleConnection(conn net.Conn) {

var network bytes.Buffer
dec := gob.NewDecoder(&network)
network.Write(outBuf[:n])
network.Write(outBuf[:(n - 8)])
err = dec.Decode(rm.instaData)
if err != nil {
slog.Error("failed to decode data", "err", err)
Expand Down

0 comments on commit d885a1c

Please sign in to comment.