PATH:
opt
/
alt
/
python38
/
lib64
/
python3.8
/
site-packages
/
aiohttp
from cpython cimport PyBytes_AsString #from cpython cimport PyByteArray_AsString # cython still not exports that cdef extern from "Python.h": char* PyByteArray_AsString(bytearray ba) except NULL from libc.stdint cimport uint32_t, uint64_t, uintmax_t def _websocket_mask_cython(object mask, object data): """Note, this function mutates its `data` argument """ cdef: Py_ssize_t data_len, i # bit operations on signed integers are implementation-specific unsigned char * in_buf const unsigned char * mask_buf uint32_t uint32_msk uint64_t uint64_msk assert len(mask) == 4 if not isinstance(mask, bytes): mask = bytes(mask) if isinstance(data, bytearray): data = <bytearray>data else: data = bytearray(data) data_len = len(data) in_buf = <unsigned char*>PyByteArray_AsString(data) mask_buf = <const unsigned char*>PyBytes_AsString(mask) uint32_msk = (<uint32_t*>mask_buf)[0] # TODO: align in_data ptr to achieve even faster speeds # does it need in python ?! malloc() always aligns to sizeof(long) bytes if sizeof(size_t) >= 8: uint64_msk = uint32_msk uint64_msk = (uint64_msk << 32) | uint32_msk while data_len >= 8: (<uint64_t*>in_buf)[0] ^= uint64_msk in_buf += 8 data_len -= 8 while data_len >= 4: (<uint32_t*>in_buf)[0] ^= uint32_msk in_buf += 4 data_len -= 4 for i in range(0, data_len): in_buf[i] ^= mask_buf[i]
[-] client_ws.py
[edit]
[-] web_runner.py
[edit]
[-] web.py
[edit]
[-] web_request.py
[edit]
[-] tcp_helpers.py
[edit]
[-] web_urldispatcher.py
[edit]
[-] client_proto.py
[edit]
[-] _helpers.cpython-38-x86_64-linux-gnu.so
[edit]
[-] web_ws.py
[edit]
[-] web_response.py
[edit]
[+]
..
[-] _find_header.pxd
[edit]
[-] web_protocol.py
[edit]
[-] _http_parser.pyx
[edit]
[-] hdrs.py
[edit]
[-] helpers.py
[edit]
[-] multipart.py
[edit]
[-] http.py
[edit]
[-] _websocket.c
[edit]
[-] _headers.pxi
[edit]
[-] signals.pyi
[edit]
[-] _http_parser.c
[edit]
[-] client_exceptions.py
[edit]
[-] _websocket.pyx
[edit]
[-] http_writer.py
[edit]
[-] _http_writer.cpython-38-x86_64-linux-gnu.so
[edit]
[-] signals.py
[edit]
[-] worker.py
[edit]
[-] web_exceptions.py
[edit]
[-] web_log.py
[edit]
[-] client.py
[edit]
[-] web_server.py
[edit]
[-] py.typed
[edit]
[-] abc.py
[edit]
[-] payload.py
[edit]
[-] formdata.py
[edit]
[-] web_middlewares.py
[edit]
[-] streams.py
[edit]
[-] pytest_plugin.py
[edit]
[-] frozenlist.py
[edit]
[+]
__pycache__
[-] _helpers.pyx
[edit]
[-] web_app.py
[edit]
[-] cookiejar.py
[edit]
[-] http_exceptions.py
[edit]
[-] payload_streamer.py
[edit]
[-] log.py
[edit]
[-] _helpers.c
[edit]
[-] test_utils.py
[edit]
[-] _find_header.c
[edit]
[-] http_parser.py
[edit]
[-] web_fileresponse.py
[edit]
[-] locks.py
[edit]
[-] _http_parser.cpython-38-x86_64-linux-gnu.so
[edit]
[-] _http_writer.pyx
[edit]
[-] tracing.py
[edit]
[-] frozenlist.pyi
[edit]
[-] resolver.py
[edit]
[-] _helpers.pyi
[edit]
[-] __init__.py
[edit]
[-] _frozenlist.c
[edit]
[-] _frozenlist.pyx
[edit]
[+]
.hash
[-] _cparser.pxd
[edit]
[-] base_protocol.py
[edit]
[-] web_routedef.py
[edit]
[-] connector.py
[edit]
[-] _frozenlist.cpython-38-x86_64-linux-gnu.so
[edit]
[-] _find_header.h
[edit]
[-] typedefs.py
[edit]
[-] _websocket.cpython-38-x86_64-linux-gnu.so
[edit]
[-] http_websocket.py
[edit]
[-] _http_writer.c
[edit]
[-] client_reqrep.py
[edit]