Skip to content

Commit d17bd81

Browse files
authored
Merge pull request #50 from robpc/fix-max-message-size
Fixes setting max message size option with subscribers
2 parents f4da85b + 43f4d2c commit d17bd81

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

pkg/server/subscriber.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,19 @@ func (s *Server) AddSubscriber(ws *websocket.Conn, realIP string, opts *Subscrib
212212
}
213213

214214
sub := Subscriber{
215-
ws: ws,
216-
realIP: realIP,
217-
outbox: make(chan *[]byte, 50_000),
218-
hello: make(chan struct{}),
219-
id: s.nextSub,
220-
wantedCollections: opts.WantedCollections,
221-
wantedDids: opts.WantedDIDs,
222-
cursor: opts.Cursor,
223-
compress: opts.Compress,
224-
deliveredCounter: eventsDelivered.WithLabelValues(realIP),
225-
bytesCounter: bytesDelivered.WithLabelValues(realIP),
226-
rl: lim,
215+
ws: ws,
216+
realIP: realIP,
217+
outbox: make(chan *[]byte, 50_000),
218+
hello: make(chan struct{}),
219+
id: s.nextSub,
220+
wantedCollections: opts.WantedCollections,
221+
wantedDids: opts.WantedDIDs,
222+
cursor: opts.Cursor,
223+
compress: opts.Compress,
224+
maxMessageSizeBytes: opts.MaxMessageSizeBytes,
225+
deliveredCounter: eventsDelivered.WithLabelValues(realIP),
226+
bytesCounter: bytesDelivered.WithLabelValues(realIP),
227+
rl: lim,
227228
}
228229

229230
s.Subscribers[s.nextSub] = &sub

0 commit comments

Comments
 (0)