Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/mist.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type (
replicators map[uint32]*localSubscriber
internal map[uint32]*localSubscriber
next uint32
size_limit uint32
}

// A Message contains the tags used when subscribing, and the data that is being
Expand All @@ -51,6 +52,7 @@ func New() *Mist {
subscribers: make(map[uint32]*localSubscriber),
replicators: make(map[uint32]*localSubscriber),
internal: make(map[uint32]*localSubscriber),
size_limit: 0,
}
}

Expand All @@ -63,6 +65,10 @@ func (mist *Mist) Publish(tags []string, data string) error {
return nil
}

if mist.size_limit != 0 && uint32(len(data)) > mist.size_limit {
return nil
}

message := Message{
Tags: tags,
Data: data,
Expand Down