/// <summary> /// Start process. /// </summary> /// <param name="headersArray">Header's byte array.</param> /// <param name="type">Type process (inbound|outbound).</param> /// <param name="flags">Frame flags.</param> private void ProcessorRun(ref byte[] headersArray, DirectionProcessType type, int flags) { foreach (IMessageProcessor processor in _processors) { if (processor.MessageProcessType == MessageProcessType.Headers) { processor.Process(ref headersArray, type, Option, flags); } } }
/// <summary> /// Processes the specified headers. /// </summary> /// <param name="headers">The headers.</param> /// <param name="type">The type.</param> /// <param name="options">Options.</param> /// <param name="flags">Flags.</param> public void Process(ref byte[] headers, DirectionProcessType type, SMProtocolOptions options, int flags) { if (!options.UseCompression) { return; } if (!options.CompressionIsStateful) { _compressOutZStream.SetDictionary(CompressionDictionary.Dictionary); _decompressOutZStream.SetDictionary(CompressionDictionary.Dictionary); } if ((flags & (byte)FrameFlags.FlagNoHeaderCompression1) == 0 && (flags & (byte)FrameFlags.FlagNoHeaderCompression2) == 0) { headers = type == DirectionProcessType.Inbound ? Decompress(headers) : Compress(headers); } }
/// <summary> /// Processes the specified headers. /// </summary> /// <param name="headers">The headers.</param> /// <param name="type">The type.</param> /// <param name="options">Options.</param> /// <param name="flags">Flags.</param> public void Process(ref byte[] headers, DirectionProcessType type, ProtocolOptions options, int flags) { if (!options.UseCompression) { return; } byte[] result = null; if (type == DirectionProcessType.Inbound) { Decompress(headers, out result); } else { Compress(headers, out result); } headers = result; }
/// <summary> /// Processes the specified input data. /// </summary> /// <param name="inputData">The input data.</param> /// <param name="type">The type.</param> /// <param name="optios">Options.</param> /// <param name="flags">Flags.</param> public void Process(ref byte[] inputData, DirectionProcessType type, SMProtocolOptions optios, int flags) { inputData = type == DirectionProcessType.Inbound ? Encrypt(inputData) : Decrypt(inputData); }
/// <summary> /// Processes the specified input data. /// </summary> /// <param name="inputData">The input data.</param> /// <param name="type">The type.</param> /// <param name="optios">Options.</param> /// <param name="flags">Flags.</param> public void Process(ref byte[] inputData, DirectionProcessType type, ProtocolOptions optios, int flags) { inputData = type == DirectionProcessType.Inbound ? Encrypt(inputData) : Decrypt(inputData); }
/// <summary> /// Processes the specified headers. /// </summary> /// <param name="headers">The headers.</param> /// <param name="type">The type.</param> /// <param name="options">Options.</param> /// <param name="flags">Flags.</param> public void Process(ref byte[] headers, DirectionProcessType type, ProtocolOptions options, int flags) { if (!options.UseCompression) return; byte[] result = null; if (type == DirectionProcessType.Inbound) { Decompress(headers, out result); } else { Compress(headers, out result); } headers = result; }
/// <summary> /// Processes the specified headers. /// </summary> /// <param name="headers">The headers.</param> /// <param name="type">The type.</param> /// <param name="options">Options.</param> /// <param name="flags">Flags.</param> public void Process(ref byte[] headers, DirectionProcessType type, SMProtocolOptions options, int flags) { if (!options.UseCompression) return; if (!options.CompressionIsStateful) { _compressOutZStream.SetDictionary(CompressionDictionary.Dictionary); _decompressOutZStream.SetDictionary(CompressionDictionary.Dictionary); } if ((flags & (byte)FrameFlags.FlagNoHeaderCompression1) == 0 && (flags & (byte)FrameFlags.FlagNoHeaderCompression2) == 0) headers = type == DirectionProcessType.Inbound ? Decompress(headers) : Compress(headers); }