github.com/cloudwego/gopkg v0.0.0-20250226090159-31bcaec4d389
Legitimate Go library code
Contains an unbounded block loopGitHub Actions workflow definition path
SHA-256662f8608b3b7757e8d1e9d6d621c3029e261b017ec64ef673ba7ee265c24a292
MaleculeH₂(Cm₂Db)Md(Bk)
Evidence
11:48… , either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package ttheader
16
17import (
18 "context"
19 "encoding/binary"
20 "net"
21 "reflect"
22 "sync"
23 "testing"
24
25 "github.com/cloudwego/gopkg/bufiox"
26)
27
28var seqId int32
29
30func TestEncodeToBytes(t *testing.T) {
31 seqId++
32 encodeParam := EncodeParam{
33 Flags: 0,
34 SeqID: seqId,
35 ProtocolID: 0,
36 IntInfo: map[uint16]string{
37 ToService: "to.service",
38 ToCluster: "to.cluster",
39 ToMethod: "method",
⋯6 lines
49:12… nil {
50 t.Fatalf("encode to bytes failed, %s", err.Error())
51 }
52 binary.BigEndian.PutUint32(buf, uint32(len(buf)-4))
53 decodeParam, err := DecodeFromBytes(context.Background(), buf)
54 if err != nil {
55 t.Fatalf("encode to …
65 var decodeParam DecodeParam
66 var wg sync.WaitGroup
67 wg.Add(1)
68 go func() {
69 defer wg.Done()
70 conn, err := l.Accept()
⋯5 lines
51:41… f []byte, typeID TType, id int16) int {
52 buf[0] = byte(typeID)
53 binary.BigEndian.PutUint16(buf[1:], uint16(id))
54 return 3
55}
⋯7 lines
255:33… msgTypeMask)
256
257 off := 4
258
259 // read method name
260 name, l, err1 := p.ReadString(buf[off:])
261 if err1 != nil {
262 return "", 0, 0, 0, errReadMessage
⋯5 lines
Showing the top 5 files — 2 more files (19 regions) not shown.
No evidence locations were recorded for this file. Raw result