!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache. PHP/5.3.29 

uname -a: Linux tardis23.nocplanet.net 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024
x86_64
 

 

Safe-mode: OFF (not secure)

/opt/alt/alt-nodejs11/root/usr/lib/node_modules/npm/node_modules.bundled/call-limit/   drwxr-xr-x
Free 979.02 GB of 1859.98 GB (52.64%)
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.27 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"use strict"

var defaultMaxRunning = 50

var limit = module.exports = function (func, maxRunning) {
  var running = 0
  var queue = []
  if (!maxRunning) maxRunning = defaultMaxRunning
  return function limited () {
    var self = this
    var args = Array.prototype.slice.call(arguments)
    if (running >= maxRunning) {
      queue.push({self: this, args: args})
      return
    }
    var cb = typeof args[args.length-1] === 'function' && args.pop()
    ++ running
    args.push(function () {
      var cbargs = arguments
      -- running
      cb && process.nextTick(function () {
        cb.apply(self, cbargs)
      })
      if (queue.length) {
        var next = queue.shift()
        limited.apply(next.self, next.args)
      }
    })
    func.apply(self, args)
  }
}

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

module.exports.promise = function (func, maxRunning) {
  var running = 0
  var queue = []
  if (!maxRunning) maxRunning = defaultMaxRunning
  return function () {
    var self = this
    var args = Array.prototype.slice.call(arguments)
    return new Promise(function (resolve) {
      if (running >= maxRunning) {
        queue.push({self: self, args: args, resolve: resolve})
        return
      } else {
        runNext(self, args, resolve)
      }
      function runNext (self, args, resolve) {
        ++ running
        resolve(
          func.apply(self, args)
          .then(finish, function (err) {
            finish(err)
            throw err
           }))
      }

      function finish () {
        -- running
        if (queue.length) {
          var next = queue.shift()
          process.nextTick(runNext, next.self, next.args, next.resolve)
        }
      }
    })
  }
}

module.exports.promise.method = function (classOrObj, method, maxRunning) {
  if (typeof classOrObj === 'function') {
    var func = classOrObj.prototype[method]
    classOrObj.prototype[method] = limit.promise(func, maxRunning)
  } else {
    var 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.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0223 ]--