!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)

/opt/cloudlinux/venv/lib/python3.11/site-packages/xray/agent/   drwxr-xr-x
Free 291.97 GB of 429.69 GB (67.95%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     executor.py (2.14 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# -*- coding: utf-8 -*-
import logging
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

import queue
from concurrent.futures import ThreadPoolExecutor, Future
from threading import BoundedSemaphore

logger = logging.getLogger(__name__)


class BoundedThreadExecutor:
    """
    BoundedExecutor behaves as a ThreadPoolExecutor which will block on
    calls to submit() once the limit given as "bound" work items are queued for
    execution.

    While processing incoming connections, we need two things:
    - the server must be able to process incoming connections
      in multiple threads (one for each client) because we spend some time
      trying to redirect incoming data to our servers
    - the server must have some limit in order not to create new
      threads indefinitely

    This executor has two limits:
    :param max_workers - which limits number of simultaneously running threads
    :param maxqueuesize - which limits number of tasks to wait for the available thread

    When both max_workers and maxqueuesize overflow, .submit function raises
    queue.Full exception.
    """
    def __init__(self, maxqueuesize, max_workers):
        self.executor = ThreadPoolExecutor(max_workers=max_workers)
        self.semaphore = BoundedSemaphore(maxqueuesize + max_workers)

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.shutdown()

    def submit(self, fn, *args, **kwargs):
        success = self.semaphore.acquire(blocking=False)
        if not success:
            raise queue.Full

        try:
            future = self.executor.submit(fn, *args, **kwargs)
        except:
            self.semaphore.release()
            raise
        else:
            future.add_done_callback(self._on_future_complete)
            return future

    def shutdown(self, wait=True):
        self.executor.shutdown(wait)

    def _on_future_complete(self, x: Future):
        self.semaphore.release()

        if x.exception():
            logger.exception('Future completed with exception')

:: 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.101 ]--