OXIESEC PANEL
- Current Dir:
/
/
lib
/
python2.7
/
site-packages
/
pip
/
_vendor
/
cachecontrol
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/16/2023 12:45:09 PM
rwxr-xr-x
📄
__init__.py
302 bytes
04/21/2022 06:08:21 PM
rw-r--r--
📄
__init__.pyc
583 bytes
04/21/2022 06:08:34 PM
rw-r--r--
📄
__init__.pyo
583 bytes
04/21/2022 06:08:34 PM
rw-r--r--
📄
_cmd.py
1.29 KB
04/21/2022 06:08:21 PM
rw-r--r--
📄
_cmd.pyc
2.01 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
_cmd.pyo
2.01 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
adapter.py
4.5 KB
04/21/2022 06:08:21 PM
rw-r--r--
📄
adapter.pyc
3.44 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
adapter.pyo
3.44 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
cache.py
790 bytes
04/21/2022 06:08:21 PM
rw-r--r--
📄
cache.pyc
2.34 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
cache.pyo
2.34 KB
04/21/2022 06:08:34 PM
rw-r--r--
📁
caches
-
03/16/2023 12:45:09 PM
rwxr-xr-x
📄
compat.py
380 bytes
04/21/2022 06:08:21 PM
rw-r--r--
📄
compat.pyc
618 bytes
04/21/2022 06:08:34 PM
rw-r--r--
📄
compat.pyo
618 bytes
04/21/2022 06:08:34 PM
rw-r--r--
📄
controller.py
12.72 KB
04/21/2022 06:08:21 PM
rw-r--r--
📄
controller.pyc
8.87 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
controller.pyo
8.87 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
filewrapper.py
2.47 KB
04/21/2022 06:08:21 PM
rw-r--r--
📄
filewrapper.pyc
2.6 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
filewrapper.pyo
2.6 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
heuristics.py
4.04 KB
04/21/2022 06:08:21 PM
rw-r--r--
📄
heuristics.pyc
5.8 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
heuristics.pyo
5.8 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
serialize.py
6.38 KB
04/21/2022 06:08:21 PM
rw-r--r--
📄
serialize.pyc
5.95 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
serialize.pyo
5.95 KB
04/21/2022 06:08:34 PM
rw-r--r--
📄
wrapper.py
498 bytes
04/21/2022 06:08:21 PM
rw-r--r--
📄
wrapper.pyc
696 bytes
04/21/2022 06:08:34 PM
rw-r--r--
📄
wrapper.pyo
696 bytes
04/21/2022 06:08:34 PM
rw-r--r--
Editing: filewrapper.py
Close
from io import BytesIO class CallbackFileWrapper(object): """ Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. This class uses members with a double underscore (__) leading prefix so as not to accidentally shadow an attribute. """ def __init__(self, fp, callback): self.__buf = BytesIO() self.__fp = fp self.__callback = callback def __getattr__(self, name): # The vaguaries of garbage collection means that self.__fp is # not always set. By using __getattribute__ and the private # name[0] allows looking up the attribute value and raising an # AttributeError when it doesn't exist. This stop thigns from # infinitely recursing calls to getattr in the case where # self.__fp hasn't been set. # # [0] https://docs.python.org/2/reference/expressions.html#atom-identifiers fp = self.__getattribute__('_CallbackFileWrapper__fp') return getattr(fp, name) def __is_fp_closed(self): try: return self.__fp.fp is None except AttributeError: pass try: return self.__fp.closed except AttributeError: pass # We just don't cache it then. # TODO: Add some logging here... return False def _close(self): if self.__callback: self.__callback(self.__buf.getvalue()) # We assign this to None here, because otherwise we can get into # really tricky problems where the CPython interpreter dead locks # because the callback is holding a reference to something which # has a __del__ method. Setting this to None breaks the cycle # and allows the garbage collector to do it's thing normally. self.__callback = None def read(self, amt=None): data = self.__fp.read(amt) self.__buf.write(data) if self.__is_fp_closed(): self._close() return data def _safe_read(self, amt): data = self.__fp._safe_read(amt) if amt == 2 and data == b'\r\n': # urllib executes this read to toss the CRLF at the end # of the chunk. return data self.__buf.write(data) if self.__is_fp_closed(): self._close() return data