Skip to content

Commit

Permalink
Fixes so that bw.Position is not used when NetworkStream (#349)
Browse files Browse the repository at this point in the history
Only works when MemoryStream (pending) is used.
  • Loading branch information
danielwertheim authored and ColinSullivan1 committed Dec 3, 2019
1 parent 84b5193 commit 2687668
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NATS.Client/Conn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ internal void publish(string subject, string reply, byte[] data, int offset, int
else
kickFlusher();

if (bw.Position + count + pubProtoLen > rbsize)
if (pending != null && bw.Position + count + pubProtoLen > rbsize)
throw new NATSReconnectBufferException("Reconnect buffer exceeded.");
}
}
Expand Down

0 comments on commit 2687668

Please sign in to comment.