Skip to content

Commit b36e9f0

Browse files
author
Divjot Arora
committed
always call SetStreaming if a StreamerConnection is given
1 parent 28e68f8 commit b36e9f0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

x/mongo/driver/operation.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,11 +611,10 @@ func (op Operation) readWireMessage(ctx context.Context, conn Connection, wm []b
611611
return nil, Error{Message: err.Error(), Labels: labels, Wrapped: err}
612612
}
613613

614-
// If the server replied with moreToCome set, the connection should be marked as "streaming".
615-
if wiremessage.IsMsgMoreToCome(wm) {
616-
if streamer, ok := conn.(StreamerConnection); ok {
617-
streamer.SetStreaming(true)
618-
}
614+
// If we're using a streamable connection, we set its streaming state based on the moreToCome flag in the server
615+
// response.
616+
if streamer, ok := conn.(StreamerConnection); ok {
617+
streamer.SetStreaming(wiremessage.IsMsgMoreToCome(wm))
619618
}
620619

621620
// decompress wiremessage

0 commit comments

Comments
 (0)