Commit 7472ad8a authored by Marc Gravell's avatar Marc Gravell

don't promise MemoryStream, in case we can't do that in the future; Stream is fine

parent e99d5005
...@@ -62,7 +62,8 @@ private static void SharedCompleteSyncOrAsync(ICompletable operation) ...@@ -62,7 +62,8 @@ private static void SharedCompleteSyncOrAsync(ICompletable operation)
} }
private void PerInstanceCompleteSyncOrAsync(ICompletable operation) private void PerInstanceCompleteSyncOrAsync(ICompletable operation)
{ {
if (operation.TryComplete(false)) if (operation == null) { }
else if (operation.TryComplete(false))
{ {
multiplexer.Trace("Completed synchronously: " + operation, name); multiplexer.Trace("Completed synchronously: " + operation, name);
Interlocked.Increment(ref completedSync); Interlocked.Increment(ref completedSync);
......
...@@ -170,7 +170,7 @@ private static void AuthenticateAsClientUsingDefaultProtocols(SslStream ssl, str ...@@ -170,7 +170,7 @@ private static void AuthenticateAsClientUsingDefaultProtocols(SslStream ssl, str
/// </summary> /// </summary>
/// <param name="bytes">The lease upon which to base the stream</param> /// <param name="bytes">The lease upon which to base the stream</param>
/// <param name="ownsLease">If true, disposing the stream also disposes the lease</param> /// <param name="ownsLease">If true, disposing the stream also disposes the lease</param>
public static MemoryStream AsStream(this Lease<byte> bytes, bool ownsLease = true) public static Stream AsStream(this Lease<byte> bytes, bool ownsLease = true)
{ {
if (bytes == null) return null; // GIGO if (bytes == null) return null; // GIGO
var segment = bytes.ArraySegment; var segment = bytes.ArraySegment;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment