internal static void PrepareForRetry(IRequestContext requestContext) { if (requestContext.Request.ContentStream != null && requestContext.Request.OriginalStreamPosition >= 0) { Stream stream = requestContext.Request.ContentStream; HashStream hashStream = stream as HashStream; if (hashStream != null) { hashStream.Reset(); stream = hashStream.GetSeekableBaseStream(); } stream.Position = requestContext.Request.OriginalStreamPosition; } }