Skip to content

Commit

Permalink
Include Command Context
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra committed Aug 7, 2024
1 parent 6a8ab66 commit 0a9bce0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
using System.Data;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Data.Common;
using Microsoft.Data.SqlClient;
using Microsoft.Data.SqlClientX.Handlers.Connection;
using Microsoft.Data.SqlClientX.Tds;
using Microsoft.Data.SqlClientX.Tds.State;

#nullable enable

Expand All @@ -25,13 +21,12 @@ internal sealed class SqlConnector
{
private static int s_spoofedServerProcessId = 1;

private readonly TdsParserX _parser;
// private readonly TdsParserX _parser;
private readonly ConnectionHandlerContext _connectionHandlerContext;

internal SqlConnector(SqlConnectionX? owningConnection, SqlConnectionString connectionOptions, SqlDataSource dataSource)
internal SqlConnector(SqlConnectionX? owningConnection, SqlDataSource dataSource)
{
OwningConnection = owningConnection;
ConnectionOptions = connectionOptions;
DataSource = dataSource;

//TODO: Set this based on the real server process id.
Expand All @@ -44,7 +39,8 @@ internal SqlConnector(SqlConnectionX? owningConnection, SqlConnectionString conn
// TODO initialize and pass ConnectionOptions into connection handler context
};

_parser = new TdsParserX(new TdsContext(this));
// TODO enable parser registration with Parser introduction.
// _parser = new TdsParserX(new TdsContext(this));
}

#region properties
Expand All @@ -55,8 +51,6 @@ internal SqlConnector(SqlConnectionX? owningConnection, SqlConnectionString conn
/// </summary>
internal SqlDataSource DataSource { get; }

internal DbConnectionOptions ConnectionOptions { get; set; }

/// <summary>
/// The server version this connector is connected to.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Data.SqlClientX.Tds.State
{
internal class TdsCommandContext
{
// TDS stream processing variables
/// <summary>
/// PLP data length indicator
/// </summary>
public ulong PlpLength;

/// <summary>
/// Length of data left to read (64 bit lengths)
/// </summary>
public ulong PlpLengthLeft;
}
}

0 comments on commit 0a9bce0

Please sign in to comment.