Skip to content

Commit

Permalink
chore: SDK update
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
  • Loading branch information
rustatian committed Aug 26, 2023
1 parent 9cc3a1b commit 38dc692
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
13 changes: 11 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package tcp

import (
"unsafe"

"github.com/roadrunner-server/errors"
"github.com/roadrunner-server/sdk/v4/pool"
"github.com/roadrunner-server/sdk/v4/utils"
)

type Srv struct {
Expand Down Expand Up @@ -38,7 +39,7 @@ func (c *Config) InitDefault() error {
continue
}

v.delimBytes = utils.AsBytes(v.Delimiter)
v.delimBytes = strToBytes(v.Delimiter)
}

if c.Pool == nil {
Expand All @@ -53,3 +54,11 @@ func (c *Config) InitDefault() error {

return nil
}

func strToBytes(data string) []byte {
if data == "" {
return nil
}

return unsafe.Slice(unsafe.StringData(data), len(data))
}
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ toolchain go1.21.0

require (
github.com/goccy/go-json v0.10.2
github.com/google/uuid v1.3.0
github.com/google/uuid v1.3.1
github.com/roadrunner-server/errors v1.3.0
github.com/roadrunner-server/sdk/v4 v4.4.0-beta.5
github.com/roadrunner-server/goridge/v3 v3.8.0
github.com/roadrunner-server/sdk/v4 v4.4.0-beta.8
go.uber.org/zap v1.25.0
)

require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/roadrunner-server/goridge/v3 v3.7.0 // indirect
github.com/roadrunner-server/tcplisten v1.4.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/roadrunner-server/errors v1.3.0 h1:kLVXpXne0jMReN7pj8KIhyYyjqKjsPC5DRGqMsd4/Fo=
github.com/roadrunner-server/errors v1.3.0/go.mod h1:XYVuhXvxi3yQaP/zCLB6QRZ0JvQIRaBa0SKFHL4WLKg=
github.com/roadrunner-server/goridge/v3 v3.7.0 h1:+Z8pezA4vvZ+/LpF7tjmwOYHa9jKrjbGtBn7RpRAswI=
github.com/roadrunner-server/goridge/v3 v3.7.0/go.mod h1:xgheswRjWvQBHRf3AEkFgLnYOSzYg13ZH0OCuDIcJpg=
github.com/roadrunner-server/sdk/v4 v4.4.0-beta.5 h1:+CmSTbz+y51auBr48ldwx6ZgAnWKl7f3537xyW8GDsU=
github.com/roadrunner-server/sdk/v4 v4.4.0-beta.5/go.mod h1:UkiAk5IdmUzkXncfy671OoH6i/zWpWc+JY3IU/AnQuc=
github.com/roadrunner-server/goridge/v3 v3.8.0 h1:V4EmDs6KfvV+F9ilh4LhmqZy76JGozdDH/S/1v2G2AA=
github.com/roadrunner-server/goridge/v3 v3.8.0/go.mod h1:L5UkNzD8aKLz6TzpqmmiHOJ6EnsadsWEYNoqK/4qoK0=
github.com/roadrunner-server/sdk/v4 v4.4.0-beta.8 h1:8N/hwwGxCCb/B66We+iVysglZxKjABZEsX36RzlLFb8=
github.com/roadrunner-server/sdk/v4 v4.4.0-beta.8/go.mod h1:zqOvxT0uVhLHiK7HIEKWzSUDqtfTjnpyVNXZUikVLvk=
github.com/roadrunner-server/tcplisten v1.4.0 h1:yWo09zktv/CSV6VywLfw4pwNcUchgTiIrW4uIICtO5M=
github.com/roadrunner-server/tcplisten v1.4.0/go.mod h1:A6+VSnW2ETGnN/e/CMdP63ZXqQDaC0UDMU6QmyuB0yM=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
Expand Down
3 changes: 2 additions & 1 deletion plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/google/uuid"
"github.com/roadrunner-server/errors"
"github.com/roadrunner-server/goridge/v3/pkg/frame"
"github.com/roadrunner-server/sdk/v4/payload"
"github.com/roadrunner-server/sdk/v4/pool"
staticPool "github.com/roadrunner-server/sdk/v4/pool/static_pool"
Expand Down Expand Up @@ -252,7 +253,7 @@ func (p *Plugin) Exec(epld *payload.Payload) (*payload.Payload, error) {
return nil, pld.Error()
}
// streaming is not supported
if pld.Payload().IsStream {
if pld.Payload().Flags&frame.STREAM != 0 {
p.RUnlock()
return nil, errors.Str("streaming is not supported")
}
Expand Down

0 comments on commit 38dc692

Please sign in to comment.