Ejemplo n.º 1
0
        /// <summary>
        /// Process encoding context update.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="changeTypeFlag">Change type flag.</param>
        /// <returns>The collection.</returns>
        private Tuple <string, string, IndexationType> ProcessEncodingContextUpdate(int command, bool changeTypeFlag)
        {
            if (!changeTypeFlag)
            {
                /* 07 -> 4.4
                 * This new maximum size MUST be lower than
                 * or equal to the value of the setting SETTINGS_HEADER_TABLE_SIZE */
                //spec tells that in this case command should be interpreted as new table size
                int newTableSize = command;

                if (_isSettingHeaderTableSizeReceived && (newTableSize <= _settingsHeaderTableSize))
                {
                    ChangeMaxHeaderTableSize(newTableSize);
                }
                else if (!_isSettingHeaderTableSizeReceived)
                {
                    ChangeMaxHeaderTableSize(newTableSize);
                }
                else
                {
                    throw new Exception("incorrect max header table size in Encoding Context Update");
                }
            }
            else if (command == 0)
            {
                _localRefSet.Clear();
            }
            else
            {
                throw new Exception("incorrect format of Encoding Context Update");
            }

            return(null);
        }