fix bug & opt optimization client text encoding #359
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1.fix map race bug
fatal error: concurrent map iteration and map write
goroutine 19 [running]: runtime.throw({0xd5b1be?, 0xc00027e150?})
/usr/lib/go-1.18/src/runtime/panic.go:992 +0x71 fp=0xc000287be0 sp=0xc000287bb0 pc=0x43caf1
runtime.mapiternext(0xd55092?)
/usr/lib/go-1.18/src/runtime/map.go:871 +0x4eb fp=0xc000287c50 sp=0xc000287be0 pc=0x41866b
Havoc/cmd/server.(*Teamserver).EventBroadcast(0xc000328640, {0x0, 0x0}, {{0x10, {0x0, 0x0}, {0xc000316060, 0x13}, {0x0, 0x0}}, ...})
/mnt/c/Havoc/teamserver/cmd/server/teamserver.go:682 +0xaa fp=0xc000287d60 sp=0xc000287c50 pc=0xb1288a
Havoc/cmd.glob..func2.1({0xc000042310?, 0xc0000422a0?})
/mnt/c/Havoc/teamserver/cmd/server.go:50 +0x170 fp=0xc000287e68 sp=0xc000287d60 pc=0xb16570
Havoc/pkg/logr.Logr.ServerStdOutInit.func1()
2.opt client text encoding