Skip to content

Commit 34005d6

Browse files
authored
Merge pull request #1626 from safchain/fix-subscrib-proto
objectstore: specify protobuf as client protocol
2 parents 1a67d0c + da6e44c commit 34005d6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

analyzer/flow_subscriber_endpoint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type FlowSubscriberEndpoint struct {
3434

3535
// SendFlows sends flow to the subscribers
3636
func (fs *FlowSubscriberEndpoint) SendFlows(flowArray *flow.FlowArray) {
37-
msg := ws.NewStructMessage("flow", "store", flowArray)
37+
msg := ws.NewStructMessage("flow", "store", flowArray.Flows)
3838
fs.pool.BroadcastMessage(msg)
3939
}
4040

contrib/objectstore/subscriber/objectstore.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ type Subscriber struct {
3939
func (s *Subscriber) OnStructMessage(c ws.Speaker, msg *ws.StructMessage) {
4040
switch msg.Type {
4141
case "store":
42-
var flowArray flow.FlowArray
43-
if err := flowArray.Unmarshal(msg.Obj); err != nil {
42+
var flows []*flow.Flow
43+
if err := json.Unmarshal(msg.Obj, &flows); err != nil {
4444
logging.GetLogger().Error("Failed to unmarshal flows: ", err)
4545
return
4646
}
47-
s.StoreFlows(flowArray.Flows)
47+
48+
s.StoreFlows(flows)
4849

4950
default:
5051
logging.GetLogger().Error("Unknown message type: ", msg.Type)

0 commit comments

Comments
 (0)