!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/lib/node_modules/npm/node_modules/call-limit/   drwxr-xr-x
Free 293.06 GB of 429.69 GB (68.2%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     call-limit.js (2.69 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
'use strict'

const defaultMaxRunning = 50

const limit = module.exports = function (func, maxRunning) {
  const state = {running: 0, queue: []}
  if (!maxRunning) maxRunning = defaultMaxRunning
  return function limited () {
    const args = Array.prototype.slice.call(arguments)
    if (state.running >= maxRunning) {
      state.queue.push({obj: this, args})
    } else {
      callFunc(this, args)
    }
  }
  function callNext () {
    if (state.queue.length === 0) return
    const next = state.queue.shift()
    callFunc(next.obj, next.args)
  }
  function callFunc (obj, args) {
    const cb = typeof args[args.length - 1] === 'function' && args.pop()
    try {
      ++state.running
      func.apply(obj, args.concat(function () {
        --state.running
        process.nextTick(callNext)
        if (cb) process.nextTick(() => cb.apply(obj, arguments))
      }))
    } catch (err) {
      --state.running
      if (cb) process.nextTick(() => cb.call(obj, err))
      process.nextTick(callNext)
    }
  }
}

module.exports.method = function (classOrObj, method, maxRunning) {
  if (typeof classOrObj === 'function') {
    const func = classOrObj.prototype[method]
    classOrObj.prototype[method] = limit(func, maxRunning)
  } else {
    const func = classOrObj[method]
    classOrObj[method] = limit(func, maxRunning)
  }
}

module.exports.promise = function (func, maxRunning) {
  const state = {running: 0, queue: []}
  if (!maxRunning) maxRunning = defaultMaxRunning
  return function limited () {
    const args = Array.prototype.slice.call(arguments)
    if (state.running >= maxRunning) {
      return new Promise(resolve => {
        state.queue.push({resolve, obj: this, args})
      })
    } else {
      return callFunc(this, args)
    }
  }
  function callNext () {
    if (state.queue.length === 0) return
    const next = state.queue.shift()
    next.resolve(callFunc(next.obj, next.args))
  }
  function callFunc (obj, args) {
    return callFinally(() => {
      ++state.running
      return func.apply(obj, args)
    }, () => {
      --state.running
      process.nextTick(callNext)
    })
  }
  function callFinally (action, fin) {
    try {
      return Promise.resolve(action()).then(value => {
        fin()
        return value
      }, err => {
        fin()
        return Promise.reject(err)
      })
    } catch (err) {
      fin()
      return Promise.reject(err)
    }
  }
}

module.exports.promise.method = function (classOrObj, method, maxRunning) {
  if (typeof classOrObj === 'function') {
    const func = classOrObj.prototype[method]
    classOrObj.prototype[method] = limit.promise(func, maxRunning)
  } else {
    const func = classOrObj[method]
    classOrObj[method] = limit.promise(func, maxRunning)
  }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0926 ]--