summaryrefslogtreecommitdiff
path: root/pkg/payload
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-05-13 17:15:00 +0300
committerValery Piashchynski <[email protected]>2021-05-13 17:15:00 +0300
commit2be94ad0400e2f523d87f47e09a7bf505edef689 (patch)
tree1824c8ee28d0c6ce2884b99d0a4eaa99dcaa9cbb /pkg/payload
parent705b69631dc91323c64a19594dcfeca06ea4fa5a (diff)
- Remove unsafe casting (replace with a less unsafe)
- Make the static plugin great again (separate plugin) - Revert new behavior Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg/payload')
-rwxr-xr-xpkg/payload/payload.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/pkg/payload/payload.go b/pkg/payload/payload.go
index bf3972aa..e1e45ac1 100755
--- a/pkg/payload/payload.go
+++ b/pkg/payload/payload.go
@@ -1,6 +1,8 @@
package payload
-import "unsafe"
+import (
+ "github.com/spiral/roadrunner/v2/utils"
+)
// Payload carries binary header and body to stack and
// back to the server.
@@ -14,10 +16,5 @@ type Payload struct {
// String returns payload body as string
func (p *Payload) String() string {
- return toString(p.Body)
-}
-
-// unsafe, but lightning fast []byte to string conversion
-func toString(data []byte) string {
- return *(*string)(unsafe.Pointer(&data))
+ return utils.AsString(p.Body)
}