feat(batch2): verify parser remainder features
This commit is contained in:
@@ -1158,6 +1158,58 @@ public sealed partial class ClientConnection
|
||||
TraceInOp("PRE", pre);
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Parser compatibility wrappers (features 2588, 2590, 2591)
|
||||
// =========================================================================
|
||||
|
||||
/// <summary>
|
||||
/// Parses protocol bytes using the shared parser state for this connection.
|
||||
/// Mirrors Go <c>client.parse</c>.
|
||||
/// </summary>
|
||||
internal Exception? Parse(byte[] buf, IProtocolHandler handler)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(buf);
|
||||
ArgumentNullException.ThrowIfNull(handler);
|
||||
|
||||
ParseCtx.Kind = Kind;
|
||||
ParseCtx.HasHeaders = Headers;
|
||||
if (_mcl > 0)
|
||||
ParseCtx.MaxControlLine = _mcl;
|
||||
if (_mpay != 0)
|
||||
ParseCtx.MaxPayload = _mpay;
|
||||
|
||||
return ProtocolParser.Parse(ParseCtx, handler, buf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks max control line enforcement for the current connection kind.
|
||||
/// Mirrors Go <c>client.overMaxControlLineLimit</c>.
|
||||
/// </summary>
|
||||
internal Exception? OverMaxControlLineLimit(byte[] arg, int mcl, IProtocolHandler handler)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(arg);
|
||||
ArgumentNullException.ThrowIfNull(handler);
|
||||
|
||||
ParseCtx.Kind = Kind;
|
||||
return ProtocolParser.OverMaxControlLineLimit(ParseCtx, handler, arg, mcl);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Re-processes stored pub args for split-buffer message payload handling.
|
||||
/// Mirrors Go <c>client.clonePubArg</c>.
|
||||
/// </summary>
|
||||
internal Exception? ClonePubArg(IProtocolHandler handler, bool lmsg)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(handler);
|
||||
|
||||
ParseCtx.Kind = Kind;
|
||||
ParseCtx.HasHeaders = Headers;
|
||||
if (_mpay != 0)
|
||||
ParseCtx.MaxPayload = _mpay;
|
||||
|
||||
return ProtocolParser.ClonePubArg(ParseCtx, handler, lmsg);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates the INFO JSON bytes sent to the client on connect.
|
||||
/// Stub — full implementation in session 09.
|
||||
|
||||
Reference in New Issue
Block a user