mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-08-28 14:52:03 +02:00
relay: fix unsafe overwriting of event buffer that affected parsed pubkeys, ids, content.
This commit is contained in:
4
relay.go
4
relay.go
@@ -13,7 +13,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
"unsafe"
|
|
||||||
|
|
||||||
"github.com/puzpuzpuz/xsync/v3"
|
"github.com/puzpuzpuz/xsync/v3"
|
||||||
)
|
)
|
||||||
@@ -224,8 +223,7 @@ func (r *Relay) ConnectWithTLS(ctx context.Context, tlsConfig *tls.Config) error
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
msgb := buf.Bytes()
|
message := string(buf.Bytes())
|
||||||
message := unsafe.String(unsafe.SliceData(msgb), len(msgb))
|
|
||||||
debugLogf("{%s} received %v\n", r.URL, message)
|
debugLogf("{%s} received %v\n", r.URL, message)
|
||||||
|
|
||||||
// if this is an "EVENT" we will have this preparser logic that should speed things up a little
|
// if this is an "EVENT" we will have this preparser logic that should speed things up a little
|
||||||
|
Reference in New Issue
Block a user